Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Inserting entities directly?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Michael Kay <mike AT saxonica.com>
  • To: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Inserting entities directly?
  • Date: Fri, 27 May 2016 15:27:07 +0100

From the XML FAQ

http://www.xom.nu/faq.xhtml#d0e186


>Does XOM support XML 1.1?

>No. XML 1.1 is an abomination. You don't need it and you shouldn't use it.

You're out of luck. XOM is very very strict about validating content
according to the XML rules, and you can't cheat. If you want something that
isn't XML 1.0, or that is more liberal in what it accepts, then you'll need a
different library.

And don't even bother to ask Elliotte: if he thinks jam is bad for you, he
won't give you jam however much you plead. He has firm views, and they are
usually right.

Michael Kay
Saxonica


> On 27 May 2016, at 14:41, nu.xom AT io7m.com wrote:
>
> Hello.
>
> I'm dealing with a text format that allows characters that are not
> allowed by XML. I'm referring to those characters in particular areas
> of the BMP [U+0001, U+0009], etc:
>
> https://en.wikipedia.org/wiki/Valid_Characters_in_XML#XML_1.0
>
> I'm trying to serialize the text as XML 1.0 and therefore obviously
> need to escape some characters. XOM transparently escapes <, &, etc,
> and this is fine. However, it raises an exception if I try to append
> text to a child that contains forbidden codepoints such as U+0001.
> If I try to manually escape characters myself by writing &#0001 and so
> on, XOM escapes the ampersand and I end up with &amp;#0001.
>
> What's the correct way to insert the characters myself such that
> they'll be escaped?
>
> M
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest






Archive powered by MHonArc 2.6.24.

Top of Page