In XSLT 3.0 xml-to-json(), set JSON output to null

I’m new to the XSLT

How to set null in the xslt value.

<string key= "Worker">         <xsl:text></xsl:text> </string> 

Output:-

{ "Worker":"" } 

I’m expecting value to be null instead of double quotes.

Expected Output:-

{ "Worker":null } 
Add Comment
1 Answer(s)

Use

<null key="Worker"/> 

The spec is at https://www.w3.org/TR/xpath-functions-31/#func-xml-to-json

Answered on July 17, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.