Hi Christian,
that's what I was afraid, http://www.w3.org/TR/xslt-30/#func-xml-to-json is just too complex to understand for me.
What about your simple-json try ? to have an easy: my_request&method=json&json=format=simple
Best regards
Florent
2015-11-09 10:17 GMT+01:00 Christian Grün christian.gruen@gmail.com:
Hi Florent,
When using a JSON format other than jsonml, your XML document to be output must comply with the rules specified in the particular format [1,2]:
xml-to-json(<string xmlns="http://www.w3.org/2005/xpath-functions">JSON</string>)
...versus...
xml-to-json(<string>JSON</string>)
[1] http://docs.basex.org/wiki/Json_Module [2] http://docs.basex.org/wiki/XQuery_3.1#fn:json-to-xml
On Mon, Nov 9, 2015 at 4:19 AM, Florent Gallaire fgallaire@gmail.com wrote:
I would like to use the new "basic" JSON via REST. With basex 8.3.1 and 8.3.2beta, my_request&method=json&json=format=jsonml works fine, but my_request&method=json&json=format=basic returns : [FOJS0006] Element 'article' has invalid namespace: ''.
What's the problem ?
Best regards
Florent
-- FLOSS Engineer & Lawyer
-- FLOSS Engineer & Lawyer
that's what I was afraid, http://www.w3.org/TR/xslt-30/#func-xml-to-json is just too complex to understand for me.
What about your simple-json try ? to have an easy: my_request&method=json&json=format=simple
The reason for all those complex conversion rules is that the conversions are lossless. With the simple conversion that we discussed earlier, it won't be possible to convert JSON back to the original XML document.
Did you try my XQuery conversion code back then? Does it solve your problems?
Christian
Best regards
Florent
2015-11-09 10:17 GMT+01:00 Christian Grün christian.gruen@gmail.com:
Hi Florent,
When using a JSON format other than jsonml, your XML document to be output must comply with the rules specified in the particular format [1,2]:
xml-to-json(<string xmlns="http://www.w3.org/2005/xpath-functions">JSON</string>)
...versus...
xml-to-json(<string>JSON</string>)
[1] http://docs.basex.org/wiki/Json_Module [2] http://docs.basex.org/wiki/XQuery_3.1#fn:json-to-xml
On Mon, Nov 9, 2015 at 4:19 AM, Florent Gallaire fgallaire@gmail.com wrote:
I would like to use the new "basic" JSON via REST. With basex 8.3.1 and 8.3.2beta, my_request&method=json&json=format=jsonml works fine, but my_request&method=json&json=format=basic returns : [FOJS0006] Element 'article' has invalid namespace: ''.
What's the problem ?
Best regards
Florent
-- FLOSS Engineer & Lawyer
-- FLOSS Engineer & Lawyer
-- FLOSS Engineer & Lawyer
Did you try my XQuery conversion code back then? Does it solve your problems?
Not heavily tested, but yes it works great for me. It should be included in BaseX.
Florent
Christian
Best regards
Florent
2015-11-09 10:17 GMT+01:00 Christian Grün christian.gruen@gmail.com:
Hi Florent,
When using a JSON format other than jsonml, your XML document to be output must comply with the rules specified in the particular format [1,2]:
xml-to-json(<string xmlns="http://www.w3.org/2005/xpath-functions">JSON</string>)
...versus...
xml-to-json(<string>JSON</string>)
[1] http://docs.basex.org/wiki/Json_Module [2] http://docs.basex.org/wiki/XQuery_3.1#fn:json-to-xml
On Mon, Nov 9, 2015 at 4:19 AM, Florent Gallaire fgallaire@gmail.com wrote:
I would like to use the new "basic" JSON via REST. With basex 8.3.1 and 8.3.2beta, my_request&method=json&json=format=jsonml works fine, but my_request&method=json&json=format=basic returns : [FOJS0006] Element 'article' has invalid namespace: ''.
What's the problem ?
Best regards
Florent
-- FLOSS Engineer & Lawyer
-- FLOSS Engineer & Lawyer
-- FLOSS Engineer & Lawyer
Not heavily tested, but yes it works great for me. It should be included in BaseX.
In order to include it, I would need to do more testing. If you experience unexpected behavior, feel free to tell us.
Florent
Christian
Best regards
Florent
2015-11-09 10:17 GMT+01:00 Christian Grün christian.gruen@gmail.com:
Hi Florent,
When using a JSON format other than jsonml, your XML document to be output must comply with the rules specified in the particular format [1,2]:
xml-to-json(<string xmlns="http://www.w3.org/2005/xpath-functions">JSON</string>)
...versus...
xml-to-json(<string>JSON</string>)
[1] http://docs.basex.org/wiki/Json_Module [2] http://docs.basex.org/wiki/XQuery_3.1#fn:json-to-xml
On Mon, Nov 9, 2015 at 4:19 AM, Florent Gallaire fgallaire@gmail.com wrote:
I would like to use the new "basic" JSON via REST. With basex 8.3.1 and 8.3.2beta, my_request&method=json&json=format=jsonml works fine, but my_request&method=json&json=format=basic returns : [FOJS0006] Element 'article' has invalid namespace: ''.
What's the problem ?
Best regards
Florent
-- FLOSS Engineer & Lawyer
-- FLOSS Engineer & Lawyer
-- FLOSS Engineer & Lawyer
-- FLOSS Engineer & Lawyer
basex-talk@mailman.uni-konstanz.de