SEection 3 of the XSLT 1.0 spec states, and I quote:
The data model used by XSLT is the same as that used by XPath with
the additions described in this section. XSLT operates on source,
result and stylesheet documents using the same data model. Any two
XML documents that have the same tree will be treated the same by
XSLT.
And section 5 of the XPath spec states:
XPath operates on an XML document as a tree. This section describes
how XPath models an XML document as a tree.
It seems to me pretty clear that there is an unambiguous tree
representation for each XML document (that is, for each sequence of
characters that adheres to the constraints of XML 1.0 + namespaces).
You can modify these trees in a variety of ways, but then you're no
longer working on the same document. Or, alternately, you are no
longer "using the same data model".
In essence,
Premise 1: The result tree the XSLT processor constructs is based
solely on the source tree and XSLT stylesheet which it is given.
Premise 2: Each namespace well-formed XML document has a single,
unambiguous data model.
Premise 3: The source tree is an instance of this data model, as
implemented by a particular processor. However, it must share the
same properties as the abstract data model and cannot make changes to
it.
Conclusion: An XSLT processor which produces a source tree by parsing
an XML document cannot make arbitrary non-XSLT transforms on that
document before transforming it.
I suspect you disagree with premise three, but if there's something
else that bothers you I'd be curious to hear your reasoning.
--
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| The XML Bible, 2nd Edition (Hungry Minds, 2001) |
| http://www.cafeconleche.org/books/bible2/ |
| http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+