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

New Post: How to read child node in an Xml file?

$
0
0
Hi,

I would like to know if it's possible to read a child by passing from the parent.
<configuration>

    <Server>
        <RootDirectory>Temp</RootDirectory>
        <IP>192.168.10.10</IP>
        <Port>350</Port>
        <UserName>USERNAME</UserName>
        <UserPassword>PASSWORD</UserPassword>       
    </Server>

</configuration>
I read the node "Server" with:
<MSBuild.ExtensionPack.Xml.XmlFile TaskAction="ReadElements" File="server.config" XPath="//configuration/Server">
            <Output TaskParameter="Elements" ItemName="Server" />
</MSBuild.ExtensionPack.Xml.XmlFile>
And I would like to display all child nodes with something like this:
<Message Text="%(Server.RootDirectory) - %(Server.IP)"/>
Any ideas?

Viewing all articles
Browse latest Browse all 1211


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