[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xalan-dev
Subject:    Re: Is Xalan processing a DOMSource correctly?
From:       "Henry Zongaro" <zongaro () ca ! ibm ! com>
Date:       2003-08-30 11:50:37
[Download RAW message or body]

Hello,

     I'm not entirely sure which reading of the specification is correct. 
There have been earlier bug reports [1-3] related to this, and I'm not 
sure that any satisfactorily answers this question.  I will submit the 
question to the JAXP Expert Group for consideration.

     It should be noted that XPath 1.0 describes some semantics for root 
nodes that certainly make it sound like the root in the XPath data model 
is a special kind of node, distinct from other kinds of nodes, such as 
elements.  For instance, section 5.1 [4] states that "The root node does 
not have an expanded name," which is not true of, say, element nodes.  The 
XPath 1.0 Errata document [5] describes the root node as corresponding "to the unique \
document information item in an XML Information Set."  Again, an element that is at \
the root of a DOM doesn't seem to fit that  description.

     In addition, the most recently published version of the DOM Level 3 
Core Working Draft Specification describes the mapping between DOM and 
Info-set in appendix C [6].  That indicates that "A Document node maps to an document \
information item."  However, it doesn't say anything about DocumentFragment.

     In some sense we're falling between the cracks of specifications 
here, because we're dealing with trees that do not describe complete 
documents.

Thanks,

Henry
[1] http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4995
[2] http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12270
[3] http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17979
[4] http://www.w3.org/TR/xpath#root-node
[5] http://www.w3.org/1999/11/REC-xpath-19991116-errata/
[6] http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030609/infoset-mapping.html#Document2Infoset
                
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com




jaccoud@petrobras.com.br
2003-08-29 09:59 AM
Please respond to xalan-dev

 
        To:     xalan-dev@xml.apache.org
        cc: 
        Subject:        Is Xalan processing a DOMSource correctly?

 

Greetings.

I have discussed this issue in the users group with Mr. Flanagan but
haven't got to a conclusion. We disagree as to specs interpretation.

The DOMSource description states that any node with a subtree can be used
as a root node (root meaning the XPath definition or "/"). In a current
application, however, I discovered that Xalan is not calling the root
template (<template match="/">) except when the root node is a Document or
a DocumentFragment. When providing a Element as root node, Xalan does not
call the root tamplate, but call a template matching the document element
instead -- it should not, the document element template should only be
called by the (provided or default) root template.
I saw nothing in the XPath that demands that the root node is a DOM
Document[Fragment] object, nor DOMSource docs state so. I also cannot see
any technical reason for limiting the root node type, since it is not used
by itself, it is only a starting point for expressions that begin with 
"/".

Can you please verify the conformity of this behaviour and my asuumptions?
I don't think Xalan should act as thus, but instead should call the root
template independently of the root node type (and *not* call the children
templates if my stylesheet defines a root template).

Thanks.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic