Sure, XPath defines a mapping from a well-formed XML document to a tree in
its data model. An XSLT processor would be dead in the market if it didn't
support that mapping. But it wouldn't be non-conformant. And it is certainly
allowed to support other ways of building the tree, starting from XML or
from anything else. One of the successes of XSLT is the ability to use a
transformation as one stage in a SAX pipeline, allowing arbitrary
manipulations of the tree before and after the XSLT transformation.
Michael Kay
Software AG
home:
work:
> -----Original Message-----
> From: Elliotte Rusty Harold [mailto:]
> Sent: 30 April 2002 20:02
> To:
> Cc: 'xml-dev'
> Subject: RE: [xml-dev] Re: I can XInclude where I [expletive deleted]
> want to
>
>
> 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/ |
> +----------------------------------+--------------------------
> -------+