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); }
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); }
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); }
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); }
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); }
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); }
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); }