Menu ▾ ▴

#10 XDMSerializer escapes already escaped &

open
nobody
None
5
2009-12-30
2009-12-30
Stivo
No

I found the problem in changeEntityRef.
I propose to exchange:
val = Utils.replaceAll(val, "&", "&");
with:
val = val.replaceAll( "&(?!(#\\d+;|amp;))", "&");
This worked for my use cases at least fine.

Discussion

  • Stivo

    Stivo - 2009-12-30

    Actually, hexadecimal is also allowed to for the &# expressions.
    So:
    val = val.replaceAll( "&(?!(#\\d+;|#x[0-9a-fA-F]+;|amp;))", "&");
    is better.

     

Log in to post a comment.