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

Subject: Re: [xsl] is XPath 3.1 xml-to-json() function useful
From: "Mukul Gandhi gandhi.mukul@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 11 Mar 2019 07:36:27 -0000
Hi Martin,
   Thanks for the explanation.

On Mon, Mar 11, 2019 at 12:59 PM Martin Honnen martin.honnen@xxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Well, my suggestion tried to make use of the XSLT 3 feature of text value
> templates with the attribute expand-text="yes"
>
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>> <http://www.w3.org/1999/XSL/Transform>
>>
>>     xmlns:xs="http://www.w3.org/2001/XMLSchema";
>> <http://www.w3.org/2001/XMLSchema>
>>     exclude-result-prefixes="#all"
>>     xmlns="http://www.w3.org/2005/xpath-functions";
>> <http://www.w3.org/2005/xpath-functions>
>>     expand-text="yes"
>>
>
> declared above
>
>     version="3.0">
>>
>>   <xsl:mode on-no-match="shallow-skip"/>
>>
>>   <xsl:output method="text"/>
>>   <xsl:strip-space elements="*"/>
>>
>>   <xsl:template match="root">
>>       <map>
>>           <map key="{local-name()}">
>>               <array key="val">
>>                   <xsl:apply-templates/>
>>               </array>
>>           </map>
>>       </map>
>>   </xsl:template>
>>
>>   <xsl:template match="val">
>>       <number>{.}</number>
>>
>
> so that here the {.} is evaluated and not taken literally.
>



-- 
Regards,
Mukul Gandhi

Current Thread