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"/>",
"reference": "<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!
EDIT - Clarification
This is the kind of JSON I would want created, given the following example XML
<term>
<name>cholecystocolonic fistula</name>
<definition>blah blah</definition>
<reference>cholecystocolostomy</reference>
<definition>XSLT is not as easy as it should be</definition>
<reference>qui</reference>
</term>
{
dictitle: "cholecystocolonic fistula",
html: "blah blah",
reference: "cholecystocolostomy",
html: "XSLT is not as easy as it should be",
reference: "qui"
}