[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: is XPath 3.1 xml-to-json() function useful

Subject: Re: is XPath 3.1 xml-to-json() function useful
From: "Christophe Marchand cmarchand@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 14 Mar 2019 16:08:20 -0000
Re:  is XPath 3.1 xml-to-json() function useful
+1 for the exceptional XSLT average developer !

Le 13/03/2019 C 21:28, Wendell Piez wapiez@xxxxxxxxxxxxxxx a C)critB :
Hi Mukul,

I agree provisionally, however I would also recast your claim a
little: I think good tools (like oXygen in this case) do make it
possible to be much more ambitious with XSLT, if only because they
make it possible to visualize, represent and manage more complex
processes, such (in this case for example) as 2-stage or multi-stage
pipelines producing specialized serialization formats including JSON.

But that sounds hard to disagree with doesn't it? Aren't we saying
that good tools make difficult things easier, if you know how to use
them? I do wonder who you have in mind when you talk about the
"average developer" as mostly, she or he would not be writing XSLT,
would they? The average XSLT developer is already exceptional. :-)

Cheers, Wendell

On Tue, Mar 12, 2019 at 1:16 AM Mukul Gandhi gandhi.mukul@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
On Mon, Mar 11, 2019 at 11:33 AM Mukul Gandhi <gandhi.mukul@xxxxxxxxx> wrote:
Lets say, we've a following input XML document,

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <val>1</val>
    <val>2</val>
    <val>3</val>
    <val>4</val>
</root>

I would want to transform above XML document to following JSON,

{
     "root": {
         "val": [
             1,
             2,
             3,
             4
         ]
     }
}

For the interest of readers, I actually got above XML to JSON conversion done using <oXygen/> XML editor, and then we (actually Martin) solved this with XSLT 3.0. As a best practice to convert XML into JSON using XSLT 3.0, I think its a good idea to get a feel of the suitable JSON document for a XML document, using tool like <oXygen/> XML, and then automate this with a XSLT 3.0 & XPath 3.1 solution.


Without support of a tool like <oXygen/> XML, I think it'll be harder for an average developer using XSLT 3.0 to produce XML to JSON conversions.




-- Regards, Mukul Gandhi XSL-List info and archive EasyUnsubscribe (by email)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.