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/29 09:05:09 UTC

[XalanJ2] Proposed changes for DocumentFrag

I'd like to make the following changes to allow a DocumentFragment to be
treated like a Document.  This will simplify the implementation of the
nodeset extension and will also be useful for a future version of XSLT
if result tree fragments become automatically convertible into
nodesets.  This does _not_ change the handling of result tree fragments
under the current implementation.  They still throw an error if you
attempt to convert them to nodesets without using the extension.

Here are the changes I'd like to make:


Index: DOMHelper.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/DOMHelper.java,v
retrieving revision 1.7
diff -r1.7 DOMHelper.java
577c577,578
<     return (Node.DOCUMENT_NODE == n.getNodeType()) ? 
---
>     int nt = n.getNodeType();
>     return ( (Node.DOCUMENT_NODE == nt) || (Node.DOCUMENT_FRAGMENT_NODE == nt) ) ? 


Index: StepPattern.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/patterns/StepPattern.java,v
retrieving revision 1.9
diff -r1.9 StepPattern.java
116c116
<     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.9
diff -r1.9 NodeTest.java
198a199,200
>     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.14
diff -r1.14 TemplateList.java
435c435
<       head = getHead(PsuedoNames.PSEUDONAME_ANY);
---
>       head = getHead(PsuedoNames.PSEUDONAME_ROOT);

Scott or someone, please let me know if you agree and I can commit the
changes.  Otherwise, let's discuss.

TIA,
Gary