Hi Giuseppe,

> <h>{ data(<!--&#45;-->) }</h>

The literal string value of the comment is "&#45;" (the codepoints are
38 35 52 53 59). You can use parse-xml-fragment() to decode character
and entity references:

parse-xml-fragment(<!--&#45;-->)

Hope this helps,
Christian


> On 27. Apr 2023, at 13:38, Christian Grün <christian.gr...@gmail.com> wrote:
>
> Hi Giuseppe,
>
> I’m sorry, I fail to understand how to simulate your use case. Could
> you please provide us with a minimized code snippet for testing?
>
> I have the comment node <!—&#45;—>.
>
>
> I assume it’s -- instead of —?
>
> If I extract its content with data() in an element, I get the following: 
> <g>&amp;#45;</g>, and it seems there is no way to force &amp;#45; to become 
> &#45; within the element.
>
>
> I tried this:
>
> let $comment := <!-- &#45; -->
> return element g { $comment }
>
> It gives me <g><!-- &#45; --></g>. I assume it differs from your approach?
>
> Grazie in anticipo,
> Christian
>
>

Reply via email to