Hello jaccoud,

Thursday, August 28, 2003, 5:21:45 PM, you wrote:


jpcb> If you read again, you will notice the spec says exactly the oposite. As
jpcb> you wisely put, names can be misleading. "Document root" does not
jpcb> necessarily mean a DOM Document object. It means only "the parent of the
jpcb> document element", as the spec carefully puts. Any parent node fits this
jpcb> definition. From the XPath point of view, the document begins at the "/"
jpcb> node.

Having done a search on the the text you are quoting, I have to
believe that you mean section 5.2 of the XSLT1.0 spec:
http://www.w3.org/TR/xslt#patterns

where the full sentencde in that reference is:
NOTE:This matches even a p element that is the document element,
since the document root is the parent of the document element.


Prior to that reference in the same portion of the spec
there exists bulleted item as an example pattern stating:
/ matches the root node

I agree with you %100 that any org.w3c.dom.Node object can be
passed to the constructor of a DOMSource

The constructor that takes a node is defined as such for the
javax.xml.transform.dom.DOMSource class

    public DOMSource(Node n)
      Create a new input source with a DOM node.
      The operation will be applied to the subtree rooted at this node.
      In XSLT, a "/" pattern still means the root of the tree (not the subtree),
      and the evaluation of global variables and parameters is done from
      the root node also.

So in a nutshell - I(and others are free to disagree - as I am not the
one who wrote any of the specs) I interpret the "/" from XPath as
being represented in a DOM tree as the Document object.

Maybe I am completely wrong - and have no qualms admitting that fact
But from the references to
the XSLT1.0 spec,
the XPath1.0 spec, and
the javadocs for javax.xml.transform.dom.DOMSource

All three are interpreted by me as definitively explaining the
behavior originally questioned.

If this information is not sufficient
I am at a loss and will leave any further discussion
to others within the usergroup that may be able to shed
a better and/or different light on the matter.

Thank you,
Dave Flanagan


Reply via email to