manu
manu

Reputation: 169

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
}

Upvotes: 0

Views: 489

Answers (1)

Michael Kay
Michael Kay

Reputation: 163262

Use

<null key="Worker"/>

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

Upvotes: 1

Related Questions