You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Gary L Peskin <ga...@firstech.com> on 2000/10/30 23:05:38 UTC

Revised diffs for DocumentFragment processing

Here are the revised diffs against the JIndented code base to handle
DocumentFragments so that they are treated like Documents.  This will
simplify the nodeset extension and will also be useful for a future
version of XSLT if RTFs become automatically convertible into nodesets.

This does _not_ change the handling of RTFs under the current
implementation.  They still throw an error if you attempt to convert
them to nodesets without using the extension.

Please review these and make sure they don't break anything.  Please
advise if you'd like me to commit.

Gary

Index: DOMHelper.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/DOMHelper.java,v
retrieving revision 1.8
diff -r1.8 DOMHelper.java
810c810,812
<     return (Node.DOCUMENT_NODE == n.getNodeType()) ? n :
n.getOwnerDocument();
---
>     int nt = n.getNodeType();
>     return ( (Node.DOCUMENT_NODE == nt) || (Node.DOCUMENT_FRAGMENT_NODE == nt) ) ? 
>            n : n.getOwnerDocument();


Index: StepPattern.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/patterns/StepPattern.java,v
retrieving revision 1.10
diff -r1.10 StepPattern.java
248c248
<     else if (nodeType == Node.DOCUMENT_NODE
---
>     else if ( (nodeType == Node.DOCUMENT_NODE || nodeType == Node.DOCUMENT_FRAGMENT_NODE)


Index: NodeTest.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/patterns/NodeTest.java,v
retrieving revision 1.10
diff -r1.10 NodeTest.java
351c351
< 
---
>     
353a354,356
>     if (Node.DOCUMENT_FRAGMENT_NODE == nodeType)
>       nodeType = Node.DOCUMENT_NODE;
> 


Index: TemplateList.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/TemplateList.java,v
retrieving revision 1.15
diff -r1.15 TemplateList.java
472,473c472
<       head = (TemplateSubPatternAssociation) m_patternTable.get(
<         PsuedoNames.PSEUDONAME_ANY);
---
>       head = m_docPatterns;