Ejemplo n.º 1
0
 internal void Insert(Token.Character characterToken)
 {
     Node node = new TextNode(characterToken.GetData(), baseUri);
     InsertNode(node);
 }
Ejemplo n.º 2
0
 internal void Insert(Token.Character characterToken)
 {
     Node node;
     // characters in script and style go in as datanodes, not text nodes
     string tagName = CurrentElement().TagName;
     if (tagName.Equals("script") || tagName.Equals("style"))
     {
         node = new DataNode(characterToken.GetData(), baseUri);
     }
     else
     {
         node = new TextNode(characterToken.GetData(), baseUri);
     }
     CurrentElement().AppendChild(node);
 }
Ejemplo n.º 3
0
 internal void Insert(Token.Comment commentToken)
 {
     Comment comment = new Comment(commentToken.GetData(), baseUri);
     Node insert = comment;
     if (commentToken.bogus)
     {
         // xml declarations are emitted as bogus comments (which is right for html, but not xml)
         string data = comment.Data;
         if (data.Length > 1 && (data.StartsWith("!", StringComparison.Ordinal) || data.StartsWith("?", StringComparison.Ordinal)))
         {
             string declaration = data.Substring(1); /*substring*/
             insert = new XmlDeclaration(declaration, comment.BaseUri, data.StartsWith("!", StringComparison.Ordinal));
         }
     }
     InsertNode(insert);
 }
Ejemplo n.º 4
0
 internal void Insert(Token.Comment commentToken)
 {
     Comment comment = new Comment(commentToken.GetData(), baseUri);
     InsertNode(comment);
 }