[Top] [All Lists]

Re: [xsl] How to unescape slash character using xml-to-json ?

2019-10-23 19:25:40
Hi, Matthieu,

See Martin Honnen's answer here:


Updated example: https://xsltfiddle.liberty-development.net/bwdwrV/2

Tim A. Thompson
Discovery Metadata Librarian
Yale University Library

On Wed, Oct 23, 2019 at 6:59 PM Matthieu RICAUD-DUSSARGET
m(_dot_)ricaud-dussarget(_at_)lefebvre-sarrut(_dot_)eu <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

Hi all,

I need to generate this json output :


I use XSLT3 function fn:xml-to-json to do this.

My input is :

<fn:map xmlns:fn="http://www.w3.org/2005/xpath-functions";>

    <fn:string key="test" escaped="false">foo/bar</fn:string>


But I always get this result with escaped slash :


Reading the spec at https://www.w3.org/TR/xslt-30/#func-xml-to-json at
paragraph “Strings are escaped as follows:” it looks like I can’t unescape
“/” (solidus?) character.

Is there really no way to do that using XSLT3  json functionality ? Did I
missed something obvious ?

Here is a running test : https://xsltfiddle.liberty-development.net/bwdwrV

Thanks in advance,



Expert XML

Tél. +33 6 63 25 95 58
80, avenue de la Marne 92120 Montrouge

XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/885568> (by
email <>)

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com

JPEG image

<Prev in Thread] Current Thread [Next in Thread>