示例#1
0
        public void VBNetProcessingInstructionAndCommentAtEndTest()
        {
            XmlDocumentExpression document = ParseUtil.ParseExpression <XmlDocumentExpression>("<Test />\n" +
                                                                                               "<!-- test -->\n" +
                                                                                               "<?target some text?>");

            Assert.IsNotEmpty(document.Expressions);
            Assert.AreEqual(3, document.Expressions.Count);

            CheckElement(document.Expressions[0], "Test", new Location(1, 1), new Location(9, 1));
            CheckContent(document.Expressions[1], " test ", XmlContentType.Comment, new Location(1, 2), new Location(14, 2));
            CheckContent(document.Expressions[2], "target some text", XmlContentType.ProcessingInstruction, new Location(1, 3), new Location(21, 3));
        }
        public override object VisitXmlDocumentExpression(XmlDocumentExpression xmlDocumentExpression, object data)
        {
            var newNode = new ObjectCreateExpression(new TypeReference("XDocument"), null);

            foreach (XmlExpression expr in xmlDocumentExpression.Expressions)
            {
                newNode.Parameters.Add(ConvertXmlExpression(expr));
            }

            ReplaceCurrentNode(newNode);

            return(base.VisitObjectCreateExpression(newNode, data));
        }
 public virtual object VisitXmlDocumentExpression(XmlDocumentExpression xmlDocumentExpression, object data)
 {
     throw new global::System.NotImplementedException("XmlDocumentExpression");
 }
 public object VisitXmlDocumentExpression(XmlDocumentExpression xmlDocumentExpression, object data)
 {
     throw new NotImplementedException();
 }
示例#5
0
 public override object VisitXmlDocumentExpression(XmlDocumentExpression xmlDocumentExpression, object data)
 {
     return(CreateResolveResult(new TypeReference("System.Xml.Linq.XDocument")));
 }