[Bug 6808] [Ser11] Whitespacing rules are too restrictive for the indent parameter

http://www.w3.org/Bugs/Public/show_bug.cgi?id=6808





--- Comment #11 from Henry Zongaro <zongaro@ca.ibm.com>  2010-06-23 14:28:50 ---
At its telecon of 3 June, 2010,[6] the XSL working group directed me to clarify
the situation where more than one rule applies - for instance, situations where
an element whose content model is element-only is nested within an element
whose content model is mixed, and vice versa.

To that end, I would like to recommend the following changes to my proposal of
comment #9:

1) Define the term "content" by reference to XML 1.0.  Define the term
"immediate content" to mean the part of the content of an element that's not
also part of the content of any child of that element.  All uses of those terms
below will be linked to these new definitions.
2) Change the constraints that refer to the content model or type of an element
to apply only to the immediate content of such elements.
3) Clarify that the most restrictive constraint that applies takes precedence.

In the case of the new suppress-indentation parameter (first requested in Bug
6535), I assumed that the intent was that indentation should be suppressed for
all elements named by the parameter as well as descendants of those elements. 
The original request doesn't make that absolutely clear, by I believe that was
likely the intent.

--------------------------------------------------------------------------------
The indent parameter controls whether the serializer MAY adjust the whitespace
in the serialized result so that a person will find it easier to read.  If the
indent parameter has the value yes, the serializer MAY output whitespace
characters in addition to the whitespace characters in the instance of the data
model.  It MAY also elide from the output whitespace characters that occurred
in the instance of the data model or replace such whitespace characters with
other whitespace characters.

[Definition: <b>Content</b> is as defined in 3.1 Start-Tags, End-Tags, and
Empty-element Tags of XML 1.0.]
[Definition: The <b>immediate content</b> of an element is the part of the
content of the element that is not also in the content of a child element
of that element.]

If the indent parameter has the value no, the serializer MUST NOT output any
additional, elide or replace whitespace characters. If the indent parameter has
the value yes, the serializer MUST use an algorithm for dealing with whitespace
characters that satisfies all of the following constraints. If more than one
constraint applies, the serializer must apply the most restrictive constraint.
That is, if any applicable constraint indicates that whitespace MUST NOT be
added, elided or replaced, that constraint prevails; if an applicable
constraint indicates that whitespace SHOULD NOT be added, elided or replaced,
while all other applicable constraints indicate that whitespace MAY be added,
elided or replaced, whitespace SHOULD NOT be added, elided or replaced.

* Whitespace characters MAY be added adjacent to a text node, only if the text
node contains only whitespace characters.  Whitespace characters in such a text
node MAY also be elided or replaced.  For example, a tab MAY be inserted as a
replacement for existing spaces.
* Whitespace characters MAY be added, elided or replaced in the immediate
content of an element whose type annotation is xs:untyped or xs:anyType and
that has element node children, in the immediate content of an element whose
content model is element only, or outside the content of any element.
* Whitespace characters MUST NOT be added, elided or replaced in the immediate
content of an element whose content model is known to be simple or empty.
* Whitespace characters SHOULD NOT be added, elided or replaced in places where
the characters would constitute significant whitespace, for example, in the
immediate content of an element that is annotated with a type other than
xs:untyped or xs:anyType, and whose content model is known to be mixed.
* Whitespace characters MUST NOT be added, elided or replaced in the content of
an element whose expanded QName is a member of the list of expanded QNames in
the value of the suppress-indentation parameter.
* Whitespace characters MUST NOT be added, elided or replaced in a part of the
result document that is controlled by an xml:space attribute with value
preserve. (See [XML10] for more information about the xml:space attribute.)
--------------------------------------------------------------------------------

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 23 June 2010 14:28:54 UTC