[Home] [By Thread] [By Date] [Recent Entries]

  • From: Michael Kay <mike@s...>
  • To: Jean Paoli <jeanpa@d...>
  • Date: Wed, 14 Dec 2022 20:07:27 +0000

If you know your XML structure and meaning, then you will always be able to get much better results by writing a custom transformation than you will get from any product working on completely generic XML with unknown semantics. For example, no generic tool is going to be able to guess whether order is important, or whether the names of wrapper elements need to be retained.

Michael Kay
Saxonica

On 14 Dec 2022, at 19:57, Jean Paoli <jeanpa@d...> wrote:

I would love recommendations for xml 2 json open source projects.
 
At Docugami, our reference output format is xml. We want to be able to recommend an xml 2 json transform (our xml represents documents, it has mixed content and ordering is important). We are looking at http://www.jsonml.org/ and https://www.newtonsoft.com/json/help/html/ConvertingJSONandXML.htm. There are issues with both and we are trying to avoid writing our own.
 
I think we slightly prefer the newtonsoft approach because they do not generate arrays systematically. With newtonsoft, elements remain unchanged, attributes are prefixed with an @ but multiple nodes with the same name at the same level are grouped together into an array which means that ordering is changed, specially compounded when you add mixed content.  Is there an open source package that mimics newtonsoft but does not group multiples nodes with the same name and also creates say a text node for each text in the mixed content case? Or are there other approaches recommended?
 
Thank you in advance !
 
-Jean



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member