Quantcast
Channel: MSBuild Extension Pack
Viewing all articles
Browse latest Browse all 1211

Commented Feature: Create ItemGroup from XPath [9717]

$
0
0
Discussed here: http://msbuildextensionpack.codeplex.com/discussions/244051

Basically the user should be able to provide and xpath which results in >=1 nodes and these should be added to an itemgroup..... We could expand to attributes being modeled as metadata too...
Comments: ** Comment from web user: mikeFourie **


ReadElements (Required: File, XPath Optional: Namespaces Output: Elements). Attributes are added as metadata


Sample Xml
<RenderingConfiguration>
<RenderEngines>
<RenderEngine ID="RE1" />
<RenderEngine ID="RE2" />
<RenderEngine ID="RE3" />
</RenderEngines>
</RenderingConfiguration>

Sample Target
<Target Name="Default">
<XmlFile TaskAction="ReadElements" File="d:\a\pathtoxmlfile.xml" XPath="//RenderingConfiguration/RenderEngines/RenderEngine">
<Output ItemName="ddd" TaskParameter="Elements"/>
</XmlFile>

<Message Text="%(ddd.Identity) --- %(ddd.ID)"/>
</Target>


Output
Project "D:\Projects\MSBuildExtensionPack\Releases\3.5.11.0\Main\Framework\XmlS
amples\XmlFile.proj" on node 1 (default targets).
Default:
XmlFile: d:\a\pathtoxmlfile.xml
Read Elements: //RenderingConfiguration/RenderEngines/RenderEngine
RenderEngine --- RE1
RenderEngine --- RE2
RenderEngine --- RE3
Done Building Project "D:\Projects\MSBuildExtensionPack\Releases\3.5.11.0\Main\
Framework\XmlSamples\XmlFile.proj" (default targets).


Viewing all articles
Browse latest Browse all 1211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>