Example #1
0
 public void RemoveProcessingInstructions()
 {
     const string pre = @"<root><?foo bar ?><node /><?foo bar ?></root>";
     const string post = @"<root><node /></root>";
     const string xpath = "//processing-instruction()";
     var task = new Remove();
     Run(pre, post, xpath, task);
 }
Example #2
0
 public void RemoveElements()
 {
     const string pre = @"<root><pre /><dummy /></root>";
     const string post = @"<root><dummy /></root>";
     const string xpath = "root/pre";
     var task = new Remove();
     Run(pre, post, xpath, task);
 }
Example #3
0
 public void RemoveComments()
 {
     const string pre = @"<root><!--COMMENT--><node /><!--COMMENT--></root>";
     const string post = @"<root><node /></root>";
     const string xpath = "//comment()";
     var task = new Remove();
     Run(pre, post, xpath, task);
 }
Example #4
0
 public void RemoveCDataSections()
 {
     const string pre = @"<root><![CDATA[]]></root>";
     const string post = @"<root></root>";
     const string xpath = "//text()";
     var task = new Remove();
     Run(pre, post, xpath, task);
 }
Example #5
0
 public void RemoveAttributes()
 {
     const string pre = @"<root pre=""""><node pre=""""/></root>";
     const string post = @"<root><node /></root>";
     const string xpath = "//@pre";
     var task = new Remove();
     Run(pre, post, xpath, task);
 }
Example #6
0
 public void TryToRemoveDocumentElement()
 {
     const string pre = @"<root><pre /><dummy /></root>";
     const string post = pre;
     const string xpath = "root";
     var task = new Remove();
     Run(pre, post, xpath, task);
 }
Example #7
0
 public void RemoveTextNodes()
 {
     const string pre = @"<root>text</root>";
     const string post = @"<root></root>";
     const string xpath = "//text()";
     var task = new Remove();
     Run(pre, post, xpath, task);
 }