JSON doesnt do Arrays properly for `entry`
This is an open discussion with 2 replies, filed under General.
Search
1_ Do you really need information as array?
2_ Do you really need all that information in JSON?
Step #1: Convert to object literals instead of array.
Step #2: Transform to JSON only the information you need.
Call the XML to JSON
formatter with this XML:
<user-types> <xsl:for-each select="/data/user-types/entry"> <xsl:element name="entry-{@id}"> <id> <xsl:value-of select="@id"/> </id> <name> <xsl:value-of select="name"/> </name> </xsl:element> </xsl:for-each> </user-types>
Then use a for each
loop in your JS.
;)
@into, you know well enough by now to not double post your problem. Please don't do it again.
Create an account or sign in to comment.
See http://stackoverflow.com/questions/24065275/xsl-trying-to-get-json-to-work
Trying to get the XML..
To be JSON, but the tag
entry
doent get turned into an array, so JS can only read one of them :(current broken JSON output
Using this XSL https://github.com/iwyg/xml-to-json