Using this input XML:
<?xml version="1.0" encoding="utf-8"?>
<Employees>
<Employee ID="1">
<FirstName>Klaus</FirstName>
<LastName>Salchner</LastName>
</Employee>
<Employee ID="2">
<FirstName>Peter</FirstName>
<LastName>Pan</LastName>
</Employee>
</Employees>
How would you get this output:
<Employees>
<FirstName>
<Employee>Klaus</Employee>
<Employee>Peter</Employee>
</FirstName>
<LastName>
<Employee>Salchner</Employee>
<Employee>Pan</Employee>
</LastName>
</Employees>
BUT- If you don't know how many fields there are going to be in the Employee elements - however, lets assume that the same elements (here being, FirstName and LastnName) will definately be present in every Employee element.
The best I've got is:
<Employees>
<xsl:for-each select="*/Employee/.">
<xsl:value-of select=".">
<xsl:value-of select="./." />
</xsl:value-of>
</xsl:for-each>
</Employees>
And I know that's wrong!
Any and all help greatly appreciated!
Thanks,
Matt.