I'm pretty new to json-lib, but I'm already extremely happy with how well it converts XML to JSON. However, I'm seeing an issue with the output with regard to one particular attribute.
An example is below. The JSON output is missing the 'type' attribute. I'm not sure if this is a special keyword and so it gets ignored, or if there's a bug somewhere.
Any help is appreciated
Xml In:
<entry>
<title>Journal of feline medicine & surgery</title>
<dss:field name="INITIAL_TITLE_SRCH" type="NONE">Journal of feline medicine & surgery</dss:field>
<dss:field name="INITIAL_AUTHOR_SRCH" type="NONE">European Society of Feline Medicine.</dss:field>
</entry>
JSON out:
"entry":{
"title":"Journal of feline medicine & surgery",
"dss:field":[
{
"@xmlns:dss":"http://SirsiDynix.com/discovery/extensions/",
"@name":"INITIAL_TITLE_SRCH",
"#text":"Journal of feline medicine & surgery"
},
{
"@xmlns:dss":"http://SirsiDynix.com/discovery/extensions/",
"@name":"INITIAL_AUTHOR_SRCH",
"#text":"European Society of Feline Medicine."
},
]
},
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Should have read the documentation.
There is a method setTypeHintsEnabled for XMLSerializer that lets you enable/disable using the 'type' attribute for JSON hints.
Just call serializer.setTypeHintsEnabled(false) on your XMLSerializer and you'll be golden.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"