Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.21 KB

README.md

File metadata and controls

38 lines (28 loc) · 1.21 KB

RobertsXmlTransformer

This library implements Microsoft's MSBuild XML transformation language. This was necesary because once upon a time Microsoft's implementation could not be distributed.

The library is functionally equivelent to XML-Document-Transform with three additional commands.

Remove Previous / Following Comment

To remove a comment in an XML file the RemovePreviousComment or RemoveFollowingComment transform can be used:

<?xml version="1.0"?>
<a xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <b>
    <c key="abc" xdt:Locator="Match(key)" xdt:Transform="RemovePreviousComment" />
  </b>
</a>

or

<?xml version="1.0"?>
<a xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <b>
    <c key="abc" xdt:Locator="Match(key)" xdt:Transform="RemoveFollowingComment" />
  </b>
</a>

Add Comment

To add a comment in an XML file the Comment transform can be used:

<?xml version="1.0"?>
<a xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <b key="abc" xdt:Locator="Match(key)" xdt:Transform="Comment(abc"></b>
</a>