non-XML characters in text nodes

I am trying to reconcile these statements:

1. http://www.w3.org/TR/xslt20/#section-Calling-Extension-Functions

  "NOTE: Implementations are not required to perform full validation of
  values returned by extension functions. For example, the effect of
  returning a string containing characters that are not legal XML 
  characters is implementation-defined."

2. http://www.w3.org/TR/query-datamodel/#TextNode

  "Text nodes encapsulate consecutive XML character data."

3. http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#string

  "[Definition:]  The string datatype represents character strings in
  XML. The ·value space· of string is the set of finite-length
  sequences of characters (as defined in [XML 1.0 (Second Edition)])
  that ·match· the Char production from [XML 1.0 (Second Edition)]."

So it is pretty clear to me that there is no way that a node in an
XPath/XQuery/XSLT node tree can contain non-XML characters; the node
must be serializable as XML.

Since it is implicit that an extension function that returns a string
must return an xs:string, the first paragraph I quoted above is moot.
I don't think you could even rephrase it to say that an implementation
may defer such validation until serialization, because a tree may not
be serialized but passed on somewhere else where XML Schema validation
takes place.

There are various places in the XSLT 2.0 spec where the fact that
text nodes can only contain XML-safe characters could be
explicitly stated:

 - near or replacing the first paragraph I quoted above
 - in the Data Model section
 - in the Serialization section

I brought up something like this before, for the 1.1 WD; see
http://lists.w3.org/Archives/Public/xsl-editors/2001JanMar/0018.html

I think Elliotte brought it up more recently, but I couldn't find the
reference offhand.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

Received on Thursday, 24 October 2002 03:46:58 UTC