@ -5458,7 +5458,7 @@ public UsingDeclaration(string @namespace, TypeReference alias) { usings = new L
@@ -5458,7 +5458,7 @@ public UsingDeclaration(string @namespace, TypeReference alias) { usings = new L
}
}
publicclassXmlAttribute:XmlExpression{
publicclassXmlAttributeExpression:XmlExpression{
stringname;
@ -5505,7 +5505,7 @@ public UsingDeclaration(string @namespace, TypeReference alias) { usings = new L
@@ -5505,7 +5505,7 @@ public UsingDeclaration(string @namespace, TypeReference alias) { usings = new L
}
}
publicXmlAttribute(){
publicXmlAttributeExpression(){
name="";
literalValue="";
expressionValue=Expression.Null;
@ -5518,11 +5518,12 @@ public UsingDeclaration(string @namespace, TypeReference alias) { usings = new L
@@ -5518,11 +5518,12 @@ public UsingDeclaration(string @namespace, TypeReference alias) { usings = new L
@"var xml = new XElement(""Test"", new XElement(""Test2"", new XAttribute(""a"", ""b"")), new XText("" hello \t""), new XCData(""any & <>""));");
}
[Test]
publicvoidXmlComment()
{
TestStatement("Dim xml = <!-- test -->",
@"var xml = new XComment("" test "");");
}
[Test]
publicvoidXmlCData()
{
TestStatement("Dim xml = <![CDATA[any & <> char]]>",
@"var xml = new XCData(""any & <> char"");");
}
[Test]
publicvoidXmlProcessingInstruction()
{
TestStatement("Dim xml = <?target testcontent?>",
@"var xml = new XProcessingInstruction(""target"", "" testcontent"");");
}
[Test]
publicvoidXmlDocumentTest()
{
TestStatement(@"Dim xml = <?xml version=""1.0""?><!-- test --><Data a='true'><A/></Data><!-- test -->",
@"var xml = new XDocument(new XDeclaration(""1.0"", null, null), new XComment("" test ""), new XElement(""Data"", new XAttribute(""a"", ""true""), new XElement(""A"")), new XComment("" test ""));");
}
[Test]
publicvoidXmlDocumentTest2()
{
TestStatement(@"Dim xml = <?xml?><!-- test --><Data a='true'><A/></Data><!-- test -->",
@"var xml = new XDocument(new XDeclaration(null, null, null), new XComment("" test ""), new XElement(""Data"", new XAttribute(""a"", ""true""), new XElement(""A"")), new XComment("" test ""));");
}
[Test]
publicvoidXmlDocumentTest3()
{
TestStatement(@"Dim xml = <?xml version=""1.0"" encoding=""utf-8""?><!-- test --><Data a='true'><A/></Data><!-- test -->",
@"var xml = new XDocument(new XDeclaration(""1.0"", ""utf-8"", null), new XComment("" test ""), new XElement(""Data"", new XAttribute(""a"", ""true""), new XElement(""A"")), new XComment("" test ""));");
}
[Test]
publicvoidXmlDocumentTest4()
{
TestStatement(@"Dim xml = <?xml version=""1.0"" encoding=""utf-8"" standalone=""yes""?><!-- test --><Data a='true'><A <%= content %> /></Data><!-- test -->",
@"var xml = new XDocument(new XDeclaration(""1.0"", ""utf-8"", ""yes""), new XComment("" test ""), new XElement(""Data"", new XAttribute(""a"", ""true""), new XElement(""A"", content)), new XComment("" test ""));");
}
[Test]
publicvoidXmlEmbeddedExpression()
{
TestStatement(@"Dim xml = <<%= name %>>Test</>",
@"var xml = new XElement(name, new XText(""Test""));");
}
[Test]
publicvoidXmlEmbeddedExpression2()
{
TestStatement(@"Dim xml = <<%= name %>><%= content %></>",