XSLT, process elements one by one
- by qui
Hi
I am quite weak at XSLT so this might seem obvious. Here is some sample XML
<term>
<name>cholecystocolonic fistula</name>
<definition>blah blah</definition>
<reference>cholecystocolostomy</reference>
</term>
And here is the XSLT I wrote a while ago to process it
<xsl:template name="term">
{
"dictitle": "<xsl:value-of select="name" disable-output-escaping="yes" />",
"html": "<xsl:value-of select="definition" disable-output-escaping="yes"/>",
"referece": "<xsl:value-of select="reference" disable-output-escaping="yes"/>
}
</xsl:template>
Basically I am creating JSON from the XML.
The requirements have now changed so that now the XML can have more than one definition tag and reference tag. They can appear in any order, i.e definition, reference, reference, definition, reference.
How can I update the XSLT to accommodate this? Probably worth mentioning that because my XSLT processor is using .NET I can only use XSLT 1.0 commands.
Many thanks!