Am 27.06.2020 um 18:32 schrieb Emmanuel Chateau:

I need to output a JSON object with HTML content without a parent element. 
Weird idea I grant you, but required by the people I work with.

Working from a map, in the map value, the content should not appear in a parent 
element. Instead of :

```
map {
     ‘key' : ‘value’,
     ‘content’ : <span>this is some <hi>content</hi> etc</span>
}
```

I would like to output something like

```
map {
     ‘key' : ‘value’,
     ‘content’ : 'this is some <hi>content</hi> etc'
}
```

Is there a way to output some HTML content without the parent element in XQuery 
?


Assuming you have the span element node, simply call the serialize
function on its child nodes e.g.

serialize(<span>this is some <hi>content</hi> etc</span>/node(), map {
'method' : 'html'})


Reply via email to