Beispiel #1
0
 public void ElementWithMixedContent()
 {
     const string pre = @"<root a=""  foo   ""><![CDATA[ text  ]]></root>";
     const string post = @"<root a=""  foo   ""><![CDATA[text]]></root>";
     const string xpath = "root";
     var task = new Trim();
     Run(pre, post, xpath, task);
 }
Beispiel #2
0
 public void ProcessingInstructions()
 {
     const string pre = @"<root><?foo     bar  ?><?foo  bar ?></root>";
     const string post = @"<root><?foo bar?><?foo bar?></root>";
     const string xpath = "//processing-instruction()";
     var task = new Trim();
     Run(pre, post, xpath, task);
 }
Beispiel #3
0
 public void ElementWithChildElements()
 {
     const string pre = @"<root><child><child-of-child>  foo    </child-of-child></child></root>";
     const string post = pre;
     const string xpath = "root";
     var task = new Trim();
     Run(pre, post, xpath, task);
 }
Beispiel #4
0
 public void Elements()
 {
     const string pre = @"<root><node> some text  </node></root>";
     const string post = @"<root><node>some text</node></root>";
     const string xpath = "//node";
     var task = new Trim();
     Run(pre, post, xpath, task);
 }
Beispiel #5
0
 public void Comments()
 {
     const string pre = @"<root><!-- COMMENT  --><!--   COMMENT --></root>";
     const string post = @"<root><!--COMMENT--><!--COMMENT--></root>";
     const string xpath = "//comment()";
     var task = new Trim();
     Run(pre, post, xpath, task);
 }
Beispiel #6
0
 public void CDataSections()
 {
     const string pre = @"<root><![CDATA[ text  ]]></root>";
     const string post = @"<root><![CDATA[text]]></root>";
     const string xpath = "//text()";
     var task = new Trim();
     Run(pre, post, xpath, task);
 }
Beispiel #7
0
 public void Attributes()
 {
     const string pre = @"<root attribute="" some text  ""></root>";
     const string post = @"<root attribute=""some text""></root>";
     const string xpath = "//@*";
     var task = new Trim();
     Run(pre, post, xpath, task);
 }
Beispiel #8
0
 public void TrimElementsWithRegularExpression()
 {
     const string pre = @"<root><node>Line 1 . Line 2 . Line 3 .</node></root>";
     const string post = @"<root><node>Line 1. Line 2. Line 3.</node></root>";
     const string xpath = "//node";
     var task = new Trim {Pattern = @"\s*\."};
     Run(pre, post, xpath, task);
 }
Beispiel #9
0
 public void TextNodes()
 {
     const string pre = @"<root> text  </root>";
     const string post = @"<root>text</root>";
     const string xpath = "//text()";
     var task = new Trim();
     Run(pre, post, xpath, task);
 }