Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XOM Canonicalization: whitespace outside document element

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] XOM Canonicalization: whitespace outside document element
  • Date: Tue, 10 Apr 2018 17:52:59 +0100

No, of course it's not a bug. Although the spec says the whitespace is
discarded, it also says in 2.3 that a newline is added back in:

Also, a trailing #xA is rendered after the closing PI symbol for PI children
of the root node with a lesser document order than the document element, and
a leading #xA is rendered before the opening PI symbol of PI children of the
root node with a greater document order than the document element.

Michael Kay
Saxonica

> On 10 Apr 2018, at 17:19, Michael Kay <mike AT saxonica.com> wrote:
>
> If I canonicalize the document
>
> <?xml-stylesheet type="text/xsl" href="bills.xsl"?>
> <Bills/>
>
> I would expect the result
>
> <?xml-stylesheet type="text/xsl" href="bills.xsl"?><Bills></Bills>
>
> But XOM gives me
>
> <?xml-stylesheet type="text/xsl" href="bills.xsl"?>
> <Bills></Bills>
>
> That is, it retains the newline after the processing instruction.
>
> The specification (https://www.w3.org/TR/xml-c14n11/#DataModel) says
>
> Whitespace outside of the root document element MUST be discarded.
>
> Is this a bug?
>
> Michael Kay
> Saxonica
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> https://lists.ibiblio.org/mailman/listinfo/xom-interest





Archive powered by MHonArc 2.6.24.

Top of Page