示例#1
0
 public void CommentTextNode()
 {
     const string pre = @"<root>text</root>";
     const string post = @"<root><!--text--></root>";
     const string xpath = "//text()";
     var task = new ConvertToComment();
     Run(pre, post, xpath, task);
 }
示例#2
0
 public void CommentProcessingInstruction()
 {
     const string pre = @"<root><?foo bar ?></root>";
     const string post = @"<root><!--<?foo bar ?>--></root>";
     const string xpath = "//processing-instruction()";
     var task = new ConvertToComment();
     Run(pre, post, xpath, task);
 }
示例#3
0
 public void CommentCDataSection()
 {
     const string pre = @"<root><![CDATA[text]]></root>";
     const string post = @"<root><!--<![CDATA[text]]>--></root>";
     const string xpath = "//text()";
     var task = new ConvertToComment();
     Run(pre, post, xpath, task);
 }
示例#4
0
 public void CommentElements()
 {
     const string pre = @"<root><element /><element /></root>";
     const string post = @"<root><!--<element />--><!--<element />--></root>";
     const string xpath = "//element";
     var task = new ConvertToComment();
     Run(pre, post, xpath, task);
 }
示例#5
0
 public void CommentAttribute()
 {
     const string pre = @"<root><element a=""a"" /><element a=""a"" /></root>";
     const string post = @"<root><element><!--a=""a""--></element><element><!--a=""a""--></element></root>";
     const string xpath = "//@a";
     var task = new ConvertToComment();
     Run(pre, post, xpath, task);
 }