[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Some things I learned about writing code
Hi Martin, I recently needed to convert JSON to XML for a one-off task, and your answer here was exactly what I needed: https://stackoverflow.com/questions/67312950/how-to-convert-json-to-xml-using -xslt My initial attempt to use it failed because some of my JSON fields were numeric instead of strings; you might want to consider updating the code to handle more field data types, to help future travellers who stumble upon your code. It's amazing how many times you have already answered a question that I am about to ask. - Chris On Sun, Sep 10, 2023 at 7:54b/AM Martin Honnen martin.honnen@xxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > Am 10.09.2023 um 13:44 schrieb Roger L Costello costello@xxxxxxxxx: > > > 1. > 2. There is input data that code consumes and output data that code > produces. What is the format of the input data? What is the format of the > output data? I like using a format that has a good query language. That way > I can run queries on the input data to check that I correctly understand > the input data and I can run queries on the output data to check that my > code generated the correct output data. I really like the XPath query > language b it is both simple and powerful. Of course, XPath is only > applicable to XML-formatted data, so I like formatting the input and output > data as XML. > > XPath 3.1 can also process and query JSON data, see the parse-json and > json-doc function and the XDM maps and arrays functions and the use of ? as > a lookup operator on XDM maps and arrays (to which JSON objects and arrays > are mapped). > > > > XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list> > EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/3519310> (by > email <>)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|