This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5433 - [SER] descendants of an XML island
Summary: [SER] descendants of an XML island
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Serialization 1.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Henry Zongaro
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
Reported: 2008-01-28 11:04 UTC by Tim Mills
Modified: 2009-06-16 15:24 UTC (History)
0 users

See Also:


Description Tim Mills 2008-01-28 11:04:29 UTC
Consider the serialization of:
declare namespace foo = "";
      <span>This will not be CDATA</span>
      <foo:span>This will not be CDATA</foo:span>
      <span>Will this be CDATA?</span>
      <foo:br />
      <br />

with serialization parameters:


1.  Should all descendants of foo:xml-island be output as if they were serialized as XML 1.0? 
2.  Should the <span> which is a descendant of foo:xml-island be output as c CDATA section?

The serialization specification states that:

"The HTML output method MUST NOT output an element differently from the XML output method unless the expanded QName of the element has a null namespace URI. [Definition: An element whose expanded QName has a non-null namespace URI MUST be output as XML. This is known as an XML Island.] "


"The cdata-section-elements parameter is not applicable to the HTML output method, except in the case of XML Islands."

From this, I'd assume that the asnwers to (1) and (2) above are both false, but if this is the then an XML island will not necessarily be serialized as well formed XML.  Is my understanding correct?
Comment 1 Henry Zongaro 2008-02-04 16:50:37 UTC
This is a personal response, not the official response of the XSL and XQuery working groups.

The fifth item in the list in section 7.1 of the serialization specification [1] has this to say, "When serializing an element whose name is in a non-null namespace, the HTML output method MUST apply the same rules (for example, indentation rules) as when serializing a div element. The descendants of such an element MUST be serialized as if they were descendants of a div element."  I take this to mean that all the normal rules of the html output method apply to the span element in the example of comment #0, and hence that the answers to your questions (1) and (2) are false and false, as you suggested.

The boundary between what is part of an XML island and what is excluded is a bit fuzzy.  Taking sections 7.1 and 7.4.4 together, I infer that the start and end tag (or empty element tag) are considered to be part of the serialized island.  Any processing instruction, comment or element node child that is in no namespace should be treated as an HTML "pond" on the XML island.

As for text node children, they are clearly descendants, so according to the text of 7.1 I've quoted above, they should be serialized as if they were children of a div element - so for instance, a serializer may use the HTML character entity reference &Beta; to represent U+03B2 (GREEK SMALL LETTER BETA), if that character cannot be represented in the output encoding.  However, the cdata-section-elements parameter clearly applies to such a text node, but does not apply to a text node child of a div element, so the text from 7.1 I've quoted clearly needs amending.

I propose the following change:  In the fifth item in the list in section 7.1, after "as if they were descendants of a div element," add the text ", except for the influence of the cdata-section-elements serialization parameter on any text node children of the element."

Comment 2 Henry Zongaro 2008-03-13 19:08:41 UTC
At its teleconference of 2008-03-13,[1] the XSL WG approved the response proposed in comment #1.  This response now needs the approval of the XQuery WG.

[1] (Members-only link)
Comment 3 Henry Zongaro 2008-03-20 13:33:07 UTC
At joint teleconference 360 of the XSL and XQuery working groups on 2008-03-18,[2] the XQuery WG concurred with the decision of the XSL WG.

Tim Mills, I trust you will find this response satisfactory.

Henry Zongaro, on behalf of the XSL and XQuery working groups

[2] (Members-only link)
Comment 4 Henry Zongaro 2008-03-31 13:50:29 UTC
This will be published as Serialization erratum SE.E4.
Comment 5 Henry Zongaro 2009-06-16 15:24:51 UTC
Published in "Errata for XSLT 2.0 and XQuery 1.0 Serialization"[1] and PER draft of "XSLT 2.0 and XQuery 1.0 Serialization (Second Edition)."[2]