qbektrix / xml2json-xslt

Automatically exported from code.google.com/p/xml2json-xslt
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

One item arrays? #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I don't see a way to create a one item array.

<array>
  <item>one</item>
</array>

produces: "array":{'one'} instead of "array": ['one']

Maybe something like advisory attributes like:
<array type="array">
...

Or maybe @json="array" would be better.

Ciao!

Original issue reported on code.google.com by docw...@gmail.com on 27 Mar 2008 at 3:15

GoogleCodeExporter commented 9 years ago
Here's a simple patch to do the above.  There isn't an easy way to hang this 
off object, so I didn't do that. 
Everything else is pretty straightforward and doesn't need this disambiguation.

Original comment by docw...@gmail.com on 27 Mar 2008 at 4:17

Attachments:

GoogleCodeExporter commented 9 years ago
A similar case is strings.  If you want <string-please>true</string-please> to 
be a string, not a boolean.  
Equally true with something that happens to be a number.

type="string" would fix both cases as well.

Needs thinking about.

Ciao!

Original comment by docw...@gmail.com on 31 Mar 2008 at 4:50

GoogleCodeExporter commented 9 years ago
Started a thread about this at:
http://groups.google.com/group/xml2json-xslt/browse_thread/thread/46c8947909641e
32

Original comment by docw...@gmail.com on 31 Mar 2008 at 8:28