Read and substitute constants in XML during XSL transformation



I have an xml with the structure,



<root>

<constant name="user">johndoe</constant>
<constant name="server">1</constant>

<connection>
<userName>${user}</userName>
<port>1234</port>
<server>matrix.${server}.abc.com</server>
</connection>

</root>


I'm extracting the information using XSLT to a CSV structure. How do I replace the constant names with their actual values? If this can be done in XSL, then I also have a few cases of 'nested' constants like,



<constant name="a">123</constant>
<constant name="b">10${a}</constant>

No comments:

Post a Comment