I have an xml of the following structure:
MeasurementDataExport
Comments
ApiCall
username
lotId
processToolId
This is a minimal example:
<MeasurementDataExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://my.company.de/Measurement/MeasurementDataExport.xsd">
<Name>MyTestName</Name>
<Comments><ApiCall><username>AName</username><lotId>12345</lotId><processToolId>67890</processToolId></ApiCall></Comments>
I am working on a xlst to get the value username. Here is how I get the value of comments:
<xsl:variable name="comments">
<xsl:copy-of select="mde:MeasurementDataExport/mde:Comments"/>
</xsl:variable>
This is how the output of that variable looks:
<ApiCall><username>Test</username><lotId>12345</lotId><processToolId>67890</processToolId></ApiCall>
As you see the variable is in an xml-format and the < and > characters were already changed to > and <. But while debugging he stores that value as type "text". So I can't dig deeper like
<xsl:value-of select="$comments/ApiCall/username" />
That is the main problem: My schema only works until the node comments, everything deeper needs to be parsed. So how can I parse the value of "Comments" to a node-structure, so that I can use deeper value-of-calls?
I tried to work with node-set, but had no success so far.
xls:copy-ofin your varibale. Use<xsl:variable name="comments" select="mde:MeasurementDataExport/mde:Comments" /><xsl:value-of select="$comments/ApiCall/username" />should do (if there are no default namspaces involved). But to say any more we need a (not)/working example of xml and xslt.