Answer the question
In order to leave comments, you need to log in
How to retrofit an XSL template to transform xml2Json?
Hello! I have an xml to json conversion template.
There is 1 problem: you need to modernize it so that all xml tags during the "pass" to json become lowercase (only tag names, the values themselves must be in the original).
Link to xsl
I don't understand xsl well. If someone is in the subject, save.
For example like this:
XML:
<Widget>
<VALUE>Dfdfdf</VALUE>
</wiDget>
"widget" : {"value" : "Dfdfdf" }
Answer the question
In order to leave comments, you need to log in
Add to the beginning of the template:
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
...
<xsl:variable name="nName" select="translate(name(.), $uppercase, $smallcase)"/>
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question