Lists Home |
Date Index |
> the characters passed to an application by the XML processor
> must be as if the XML processor normalized all line breaks
> in external parsed entities (including the document entity)
> on input, before parsing
In my experience, the words "as if" are often a signal that something is
badly wrong in a spec. Either the processor should normalize line
breaks, in which case it must be made very clear at which stage of
processing it does so, or it shouldn't normalize them. Saying that it
behaves for some purposes as it it normalized them and for other
purposes as if it didn't is a sure path to ambiguity, and a sure signal
that the processing model has not been adequately defined.
There are examples of this in XSLT 1.0:
"the stylesheet is treated as if neither processing instruction nodes
nor comment nodes were included in the tree that represents the
stylesheet" - but is this the tree before or after whitespace stripping?
"document('') refers to the root node of the stylesheet; the tree
representation of the stylesheet is exactly the same as if the XML
document containing the stylesheet was the initial source document" -
does this "as if" override the previous "as if"?
In all these cases the problems would be avoided by describing a
processing model in which the stages of processing (of an object such as
a stylesheet) are explicitly described, and constraints are defined on
the object at a specific stage of processing.