sboag       99/12/16 01:06:06

  Modified:    src/org/apache/xalan/xpath SimpleNodeLocator.java
               src/org/apache/xalan/xpath/dtm DTM.java DTMProxy.java
               src/org/apache/xalan/xslt XSLTEngineImpl.java
               src/org/apache/xalan/xslt/extensions Redirect.java
  Log:
  match pattern "node()" now only matches non-attributes, as per: "A pattern is 
defined to match a node if and only if there is possible context such that when 
the pattern is evaluated as an expression with that context, the node is a 
member of the resultin
  
  Revision  Changes    Path
  1.6       +19 -5     
xml-xalan/src/org/apache/xalan/xpath/SimpleNodeLocator.java
  
  Index: SimpleNodeLocator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/src/org/apache/xalan/xpath/SimpleNodeLocator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SimpleNodeLocator.java    1999/12/16 03:50:32     1.5
  +++ SimpleNodeLocator.java    1999/12/16 09:06:04     1.6
  @@ -1531,6 +1531,7 @@
           scoreHolder[0] = xpath.MATCH_SCORE_NONE;
         if(scoreHolder[0] == xpath.MATCH_SCORE_NONE)
           return null;
  +      
         scoreHolder[0] = xpath.MATCH_SCORE_OTHER;
         context = execContext.getParentOfNode(context);
         if(null == context)
  @@ -1551,7 +1552,7 @@
           for(int i = 0; i < len; i++)
           {
             Node n = nl.item(i);
  -          score = (n == context) ? xpath.MATCH_SCORE_OTHER : 
xpath.MATCH_SCORE_NONE;
  +          score = (n.equals(context)) ? xpath.MATCH_SCORE_OTHER : 
xpath.MATCH_SCORE_NONE;
             if(score == xpath.MATCH_SCORE_OTHER)
             {
               context = n;
  @@ -1581,8 +1582,9 @@
           break;
         }
       case xpath.MATCH_ANY_ANCESTOR:
  +      argLen = xpath.getArgLengthOfStep(opPos);
  +      if(context.getNodeType() != Node.ATTRIBUTE_NODE)
         {
  -        argLen = xpath.getArgLengthOfStep(opPos);
           opPos = xpath.getFirstChildPosOfStep(opPos);
           score = xpath.MATCH_SCORE_NONE;
           while(null != context)
  @@ -1590,14 +1592,26 @@
             score = nodeTest(xpath, execContext, context, opPos, argLen, 
stepType);
             if(xpath.MATCH_SCORE_NONE != score)
               break;
  -          context = execContext.getParentOfNode(context);
  +          // context = execContext.getParentOfNode(context);
  +          context = context.getParentNode();
           }
         }
  +      else
  +      {
  +        score = xpath.MATCH_SCORE_NONE;
  +      }
         break;
       case xpath.MATCH_IMMEDIATE_ANCESTOR:
         argLen = xpath.getArgLengthOfStep(opPos);
  -      opPos = xpath.getFirstChildPosOfStep(opPos);
  -      score = nodeTest(xpath, execContext, context, opPos, argLen, stepType);
  +      if(context.getNodeType() != Node.ATTRIBUTE_NODE)
  +      {
  +        opPos = xpath.getFirstChildPosOfStep(opPos);
  +        score = nodeTest(xpath, execContext, context, opPos, argLen, 
stepType);
  +      }
  +      else
  +      {
  +        score = xpath.MATCH_SCORE_NONE;
  +      }
         break;
       default:
         argLen = xpath.getArgLengthOfStep(opPos);
  
  
  
  1.7       +70 -70    xml-xalan/src/org/apache/xalan/xpath/dtm/DTM.java
  
  Index: DTM.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xpath/dtm/DTM.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DTM.java  1999/12/14 22:25:09     1.6
  +++ DTM.java  1999/12/16 09:06:05     1.7
  @@ -272,7 +272,7 @@
     /**
      * Return a Node object that represents the index.
      */
  -  public DTMProxy getNode(int pos)
  +  public final DTMProxy getNode(int pos)
     {
       if(true)
       {
  @@ -280,7 +280,7 @@
         if(0 == pos)
         {
           if(null == document)
  -          document = new DTMProxy(this, pos);
  +          document = new DTMProxy(this, pos, Node.DOCUMENT_NODE);
           return document;
         }
         return new DTMProxy(this, pos);
  @@ -312,7 +312,7 @@
      * @return int As in ChunkedIntArray.append
      * @see ChunkedIntArray.append
      */
  -  private int appendNode(int w0, int w1, int w2, int w3)
  +  private final int appendNode(int w0, int w1, int w2, int w3)
     {
       // A decent compiler will probably inline this.
       int slotnumber = nodes.appendSlot(w0, w1, w2, w3);
  @@ -352,7 +352,7 @@
      * Text and CDATA.
      * @see characters()
      */
  -  public void appendAccumulatedText()
  +  public final void appendAccumulatedText()
     {
       // No text pending
       int slotsUsed = charOffsets.slotsUsed();
  @@ -430,7 +430,7 @@
      * Currently a no-op in DTM.
      * @param locator Locator SAX locator object.
      */
  -  public void setDocumentLocator(org.xml.sax.Locator locator) 
  +  public final void setDocumentLocator(org.xml.sax.Locator locator) 
     {
       // No-op
     }
  @@ -440,7 +440,7 @@
      * DTM responds by initializing Node 0, which has special meaning during
      * parsing but is in some sense also the Document Node.
      */
  -  public void startDocument() 
  +  public final void startDocument() 
       throws org.xml.sax.SAXException 
     {
       nodes.writeSlot(0,Node.DOCUMENT_NODE,-1,-1,0);
  @@ -459,7 +459,7 @@
      * but also has the side effect of switching DTM into its XML4J-aware
      * mode.
      */
  -  public void startDocument(int versionIndex,
  +  public final void startDocument(int versionIndex,
                               int encodingIndex,
                               int standAloneIndex) 
     {
  @@ -482,7 +482,7 @@
      * no-more-nodes-expected, and wake up anyone who is waiting.
      * @exception org.xml.sax.SAXException Not used.
      */
  -  public void endDocument() 
  +  public final void endDocument() 
       throws org.xml.sax.SAXException
     {
       if(DISABLE)return;
  @@ -518,7 +518,7 @@
      * @param name java.lang.String Qualified name of the Element
      * @param atts org.xml.sax.AttributeList A set of attributes to be added.
      */
  -  public void startElement(String name, AttributeList atts)
  +  public final void startElement(String name, AttributeList atts)
     {
       appendAccumulatedText();
       
  @@ -610,7 +610,7 @@
      * @param attrListIndex int Starting index of this element's attributes
      * in the parser's attribute table, or -1 to indicate no attributes.
      */
  -  public void startElement(int elementNameIndex,
  +  public final void startElement(int elementNameIndex,
                              org.apache.xerces.framework.XMLAttrList 
xmlAttrList, 
                              int attrListIndex) 
     {
  @@ -772,7 +772,7 @@
      * XMLDocumentHandler version.
      * @param name java.lang.String Element name
      */
  -  public void endElement(String name)
  +  public final void endElement(String name)
     {    
       endElement(stringToInt(name));
     }
  @@ -782,7 +782,7 @@
      * has been properly terminated.
      * @param name int Index of element name in XML4J's symbol table
      */
  -  public void endElement(int name)
  +  public final void endElement(int name)
     {
       if(DISABLE)return;    
       int thisElement = currentParent;
  @@ -819,7 +819,7 @@
      * @exception org.xml.sax.SAXException Required by API, not thrown as far
      * as I know.
      */
  -  public void characters(char ch[], int start, int length) 
  +  public final void characters(char ch[], int start, int length) 
       throws org.xml.sax.SAXException
     {
       if(processingIgnorableWhitespace)
  @@ -842,7 +842,7 @@
      * @exception org.xml.sax.SAXException Required by API, not thrown as far
      * as I know.
      */
  -  public void characters(char ch[], int start, int length, boolean 
cdataSection) 
  +  public final void characters(char ch[], int start, int length, boolean 
cdataSection) 
       throws org.xml.sax.SAXException
     {
       // XML4J, currently not used
  @@ -860,7 +860,7 @@
      * @exception org.xml.sax.SAXException Required by API, not thrown as far
      * as I know.
      */
  -  public void characters(int dataIndex) 
  +  public final void characters(int dataIndex) 
       throws org.xml.sax.SAXException
     {
       if(DISABLE)return;
  @@ -870,17 +870,17 @@
     }
     
     /** Start CDATA section. */
  -  public void startCDATA() throws Exception 
  +  public final void startCDATA() throws Exception 
     {
     }
   
     /** End CDATA section. */
  -  public void endCDATA() throws Exception 
  +  public final void endCDATA() throws Exception 
     {
     }
     
     /** Ignorable whitespace. */
  -  public void ignorableWhitespace(int dataIndex) 
  +  public final void ignorableWhitespace(int dataIndex) 
       throws Exception 
     {
       general_characters(dataIndex);
  @@ -898,7 +898,7 @@
      * @exception org.xml.sax.SAXException Required by API, not thrown as far
      * as I know.
      */
  -  public void ignorableWhitespace(char ch[], int start, int length) 
  +  public final void ignorableWhitespace(char ch[], int start, int length) 
       throws org.xml.sax.SAXException
     {
       if(!processingIgnorableWhitespace)
  @@ -923,7 +923,7 @@
      * @exception org.xml.sax.SAXException Required by API, not thrown as far
      * as I know.
      */
  -  public void ignorableWhitespace(char ch[], int start, int length, boolean 
cdataSection) 
  +  public final void ignorableWhitespace(char ch[], int start, int length, 
boolean cdataSection) 
       throws org.xml.sax.SAXException
     {
       // ***** Ignoring the CDATASection flag for now
  @@ -940,7 +940,7 @@
      * @exception org.xml.sax.SAXException Required by API, not thrown as far
      * as I know.
      */
  -  public void ignorableWhitespace(int dataIndex, boolean cdataSection) 
  +  public final void ignorableWhitespace(int dataIndex, boolean cdataSection) 
       throws org.xml.sax.SAXException
     {
       if(!processingIgnorableWhitespace)
  @@ -958,7 +958,7 @@
      * @param start int Zero-based offset of the start of the string
      * @param length int Number of characters
      */
  -  public void general_characters(char ch[], int start, int length) 
  +  public final void general_characters(char ch[], int start, int length) 
     {
       // We need to normalize the document. That means
       // we need to buffer text until Something Else Happens.
  @@ -1023,7 +1023,7 @@
      *<p>
      * KNOWN LIMITATION: DOESN'T PRESERVE CDATA FLAG.
      */
  -  public void general_characters(int index) 
  +  public final void general_characters(int index) 
     {
       // record the characters() into the buffering offset tables.
       int l=charOffsets.appendSlot(0,index,0,0);
  @@ -1035,7 +1035,7 @@
      * late-binding form, and not supported in SAX 1.0 at all.
      * @param dataIndex int Index of comment's contents in XML4J's symbol table
      */
  -  public void comment(int dataIndex) 
  +  public final void comment(int dataIndex) 
     {
       if(DISABLE)return;
       
  @@ -1066,7 +1066,7 @@
      * @exception org.xml.sax.SAXException Required by API, not thrown as far
      * as I know.
      */
  -  public void processingInstruction(String target, String data) 
  +  public final void processingInstruction(String target, String data) 
       throws org.xml.sax.SAXException
     {
       processingInstruction(stringToInt(target),stringToInt(data));
  @@ -1077,7 +1077,7 @@
      * @param target int target processor name index
      * @param data int Index of PI parameters to be passed to that processor
      */
  -  public void processingInstruction(int target, int data) 
  +  public final void processingInstruction(int target, int data) 
     {
       if(DISABLE)return;
       
  @@ -1100,17 +1100,17 @@
   
     
     /** Report the start of the scope of a namespace declaration. */
  -  public void startNamespaceDeclScope(int prefix, int uri) throws Exception 
  +  public final void startNamespaceDeclScope(int prefix, int uri) throws 
Exception 
     {
     }
   
     /** Report the end of the scope of a namespace declaration. */
  -  public void endNamespaceDeclScope(int prefix) throws Exception 
  +  public final void endNamespaceDeclScope(int prefix) throws Exception 
     {
     }
     
     /** Start entity reference. */
  -  public void startEntityReference(int entityName, int entityType,
  +  public final void startEntityReference(int entityName, int entityType,
                                      int entityContext) throws Exception 
     {
       /*
  @@ -1140,7 +1140,7 @@
     } // startEntityReference(int,int,int)
   
     /** End entity reference. */
  -  public void endEntityReference(int entityName, int entityType,
  +  public final void endEntityReference(int entityName, int entityType,
                                    int entityContext) throws Exception 
     {
     } // endEntityReference(int,int,int)
  @@ -1150,7 +1150,7 @@
     //==========================================================
     private final void ____DTDHandling____(){}
     
  -  private void initDefaultEntities()
  +  private final void initDefaultEntities()
     {
       fAmpIndex = fStringPool.addSymbol("amp");
       fLtIndex = fStringPool.addSymbol("lt");
  @@ -1180,7 +1180,7 @@
      *  This function will be called when a &lt;!DOCTYPE...&gt; declaration is
      *  encountered.
      */
  -  public void startDTD(int rootElementType, int publicId, int systemId)
  +  public final void startDTD(int rootElementType, int publicId, int systemId)
       throws Exception 
     {
       String qualifiedName = fStringPool.toString(rootElementType);
  @@ -1194,12 +1194,12 @@
     /**
      *  This function will be called at the end of the DTD.
      */
  -  public void endDTD() throws Exception {}
  +  public final void endDTD() throws Exception {}
   
     /**
      * &lt;!ELEMENT Name contentspec&gt;
      */
  -  public void elementDecl(int elementTypeIndex,
  +  public final void elementDecl(int elementTypeIndex,
                             
org.apache.xerces.framework.XMLValidator.ContentSpec contentModel)
       throws Exception 
     {
  @@ -1213,7 +1213,7 @@
     /**
      * &lt;!ATTLIST Name AttDef&gt;
      */
  -  public void attlistDecl(int elementTypeIndex,
  +  public final void attlistDecl(int elementTypeIndex,
                             int attrNameIndex, int attType,
                             String enumString,
                             int attDefaultType, int attDefaultValue)
  @@ -1251,7 +1251,7 @@
     /**
      * Get the element identified by the ID.
      */
  -  public Element getIdentifier(String id)
  +  public final Element getIdentifier(String id)
     {
       int strIndex = fStringPool.addSymbol(id);
       int elemNum = m_idMap.get(strIndex);
  @@ -1283,17 +1283,17 @@
     /**
      * &lt;!ENTITY % Name EntityValue&gt; (internal)
      */
  -  public void internalPEDecl(int entityName, int entityValue) throws 
Exception {}
  +  public final void internalPEDecl(int entityName, int entityValue) throws 
Exception {}
   
     /**
      * &lt;!ENTITY % Name ExternalID>                (external)
      */
  -  public void externalPEDecl(int entityName, int publicId, int systemId) 
throws Exception {}
  +  public final void externalPEDecl(int entityName, int publicId, int 
systemId) throws Exception {}
     
     /**
      * Declare an entity.
      */
  -  private void declareEntity(int entityName, int entityValue)
  +  private final void declareEntity(int entityName, int entityValue)
     {
       int w0=org.w3c.dom.Node.ENTITY_NODE;
       // W1: Parent
  @@ -1320,7 +1320,7 @@
     /**
      * &lt;!ENTITY Name EntityValue&gt; (internal)
      */
  -  public void internalEntityDecl(int entityName, int entityValue)
  +  public final void internalEntityDecl(int entityName, int entityValue)
       throws Exception 
     {
       if(null == m_entityNodes)
  @@ -1334,7 +1334,7 @@
     /**
      * &lt;!ENTITY Name ExternalID>                (external)
      */
  -  public void externalEntityDecl(int entityName, int publicId, int systemId)
  +  public final void externalEntityDecl(int entityName, int publicId, int 
systemId)
       throws Exception 
     {
       if(null == m_entityNodes)
  @@ -1365,7 +1365,7 @@
     /**
      * &lt;!ENTITY Name ExternalID NDataDecl>      (unparsed)
      */
  -  public void unparsedEntityDecl(int entityName,
  +  public final void unparsedEntityDecl(int entityName,
                                    int publicId, int systemId,
                                    int notationName) throws Exception 
     {
  @@ -1398,7 +1398,7 @@
     /**
      * &lt;!NOTATION Name ExternalId>
      */
  -  public void notationDecl(int notationName, int publicId, int systemId)
  +  public final void notationDecl(int notationName, int publicId, int 
systemId)
       throws Exception 
     {
   
  @@ -1421,7 +1421,7 @@
     /**
      * Return the document proxy object.
      */
  -  public Document getDocument()
  +  public final Document getDocument()
     {
       if(TRACE)
         System.out.println("DTM: getDocument");
  @@ -1461,7 +1461,7 @@
      * @param postition int Index of this node's record.
      * @return int DTM node-number of first child, or -1 to indicate none 
exists.
      */
  -  public int getFirstChild(int position)
  +  public final int getFirstChild(int position)
     {
       if(TRACE)
         System.out.println("DTM: getFirstChild");
  @@ -1531,7 +1531,7 @@
      * @param postition int Index of this node's record.
      * @return int DTM node-number of first child, or -1 to indicate none 
exists.
      */
  -  public int getFirstAttribute(int position)
  +  public final int getFirstAttribute(int position)
     {
       if(TRACE)
         System.out.println("DTM: getFirstAttribute");
  @@ -1589,7 +1589,7 @@
      * @return int DTM node-number of the resolved attr, 
      * or -1 to indicate none exists.
      */
  -  public int getNextAttribute(int position)
  +  public final int getNextAttribute(int position)
     {
       if(TRACE)
         System.out.println("DTM: getNextAttribute: "+position);
  @@ -1668,7 +1668,7 @@
      * @return int Node-number of last child,
      * or -1 to indicate none exists.
      */
  -  public int getLastChild(int position)
  +  public final int getLastChild(int position)
     {
       if(TRACE)
         System.out.println("DTM: getLastChild");
  @@ -1702,7 +1702,7 @@
      * @return int Node-number of next sibling,
      * or -1 to indicate none exists.
      */
  -  public int getNextSibling(int position)
  +  public final int getNextSibling(int position)
     {
       if(TRACE)
         System.out.println("DTM: getNextSibling");
  @@ -1778,7 +1778,7 @@
      * @return int Node-number of next descendant,
      * or -1 to indicate none exists.
      */
  -  public int getNextDescendant(int parentPos, int position)
  +  public final int getNextDescendant(int parentPos, int position)
     {
       if(TRACE)
         System.out.println("DTM: getNextDescendant");
  @@ -1853,7 +1853,7 @@
      * @return int Node-number of next sibling,
      * or -1 to indicate none exists.
      */
  -  public int getNextNode(int parentPos, int position)
  +  public final int getNextNode(int parentPos, int position)
     {    
       if(TRACE && false)
         System.out.println("DTM: getNextNode");
  @@ -1918,7 +1918,7 @@
      * @return int Node-number of parent,
      * or -1 to indicate none exists.
      */
  -  public int getParent(int position)
  +  public final int getParent(int position)
     {
       if(TRACE)
         System.out.println("DTM: getParent");
  @@ -1941,7 +1941,7 @@
      * @return int Node-number of the previous sib,
      * or -1 to indicate none exists.
      */
  -  public int getPreviousSibling(int position)
  +  public final int getPreviousSibling(int position)
     {
       if(TRACE)
         System.out.println("DTM: getPreviousSibling");
  @@ -1977,7 +1977,7 @@
      * @return int Node-number of preceding sibling,
      * or -1 to indicate none exists.
      */
  -  public int getNextPreceding(int startPos, int position)
  +  public final int getNextPreceding(int startPos, int position)
     {    
       if(TRACE)
         System.out.println("DTM: getNextPreceding");
  @@ -2019,7 +2019,7 @@
      * @return int Node-number of preceding sibling,
      * or -1 to indicate none exists.
      */
  -  public int getPrecedingOrAncestorOrSelf(int position)
  +  public final int getPrecedingOrAncestorOrSelf(int position)
     {    
       if(TRACE)
         System.out.println("DTM: getPrecedingOrAncestorOrSelf");
  @@ -2051,7 +2051,7 @@
      * @param postition int Index of this node's record.
      * @return String Name of this node.
      */
  -  public String getNodeName(int position)
  +  public final String getNodeName(int position)
     {
       // int strIndex = nodes.readEntry(position, 3);
       // return fStringPool.toString( 
fStringPool.getFullNameForQName(strIndex) );
  @@ -2072,7 +2072,7 @@
      * @param postition int Index of this node's record.
      * @return String Local name of this node.
      */
  -  public String getLocalName(int position)
  +  public final String getLocalName(int position)
     {
       // return  fStringPool.toString( 
fStringPool.getLocalPartForQName(nodes.readEntry(position, 3)) );
       String name=getNodeName(position);
  @@ -2095,7 +2095,7 @@
      * @return String prefix of this node's name, or null if no explicit
      * namespace prefix was given.
      */
  -  public String getPrefix(int position)
  +  public final String getPrefix(int position)
     {
       // return  fStringPool.toString( 
fStringPool.getFullNameForQName(nodes.readEntry(position, 3)) );
       String name=getNodeName(position);
  @@ -2111,7 +2111,7 @@
      * @return String URI value of this node's namespace, or null if no
      * namespace was resolved.
      */
  -  public String getNamespaceURI(int position)
  +  public final String getNamespaceURI(int position)
     {
       if(position==0)
         return null;
  @@ -2137,7 +2137,7 @@
      * @return String Value of this node, or null if not 
      * meaningful for this node type.
      */
  -  public String getNodeValue(int position)
  +  public final String getNodeValue(int position)
     {
       nodes.readSlot(position, gotslot);
       int nodetype=gotslot[0] & 0xFF;
  @@ -2215,7 +2215,7 @@
      * @param postition int Index of this node's record.
      * @return int Node type, as per the DOM's Node._NODE constants.
      */
  -  public int getNodeType(int position)
  +  public final int getNodeType(int position)
     {
       return nodes.readEntry(position,0)&0xff;
     }
  @@ -2227,7 +2227,7 @@
      * @return boolean true iff the node was created via an ignorableWhitespace
      * event.
      */
  -  public boolean isIgnorableText(int position)
  +  public final boolean isIgnorableText(int position)
     {
       return (position == 0) 
              ? false
  @@ -2240,7 +2240,7 @@
      * in extremely terse form onto Standard Output.
      * @param postition int Index of this node's record.
      */
  -  public void display(int position)
  +  public final void display(int position)
     {
       if(position == 0)
         System.out.println("0:\tDocument (implicit first child = 1)");
  @@ -2259,7 +2259,7 @@
      * @see display
      *
      */
  -  public void dump()
  +  public final void dump()
     {
       for(int i=0;i<=nodes.lastUsed;++i)
         display(i);
  @@ -2271,7 +2271,7 @@
      * @param s String to be added
      * @return int Index number assigned to this string
      */
  -  private int stringToInt(String s)
  +  private final int stringToInt(String s)
     {
       // Used only for SAX-based input
       // When recieving from XML4J, numbers were precalculated
  @@ -2295,7 +2295,7 @@
      * @param int Index number of desired string
      * @return String String represented by that number.
      */
  -  private String intToString(int i)
  +  private final String intToString(int i)
     {
       if(fStringPool==null)
         return (String)symbolList.elementAt(i);
  @@ -2309,7 +2309,7 @@
      * @param prefix String prefix to be resolved
      * @return String Namespace URI which that prefix currently points to.
      */
  -  private String resolveNamespace(String prefix)
  +  private final String resolveNamespace(String prefix)
     {
       if(prefix==null || prefix.length() == 0)
         prefix=DEFAULT_PREFIX_STR;
  @@ -2325,7 +2325,7 @@
      * @param prefix String prefix to be resolved
      * @return String Namespace URI which that prefix currently points to.
      */
  -  private boolean isDefaultNamespaceInEffect()
  +  private final boolean isDefaultNamespaceInEffect()
     {
       return namespaceTable.containsKey(DEFAULT_PREFIX_STR);
     }
  @@ -2354,7 +2354,7 @@
     /**
      * @see #setCreateEntityReferenceNodes
      */
  -  public boolean getCreateEntityReferenceNodes() 
  +  public final boolean getCreateEntityReferenceNodes() 
     {
       return fCreateEntityReferenceNodes;
     }
  @@ -2368,7 +2368,7 @@
           super(stringPool, errorReporter, entityHandler);
       }
     
  -    public void loadSchema(String uri) {}
  +    public final void loadSchema(String uri) {}
     }
   
   
  
  
  
  1.4       +70 -61    xml-xalan/src/org/apache/xalan/xpath/dtm/DTMProxy.java
  
  Index: DTMProxy.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xpath/dtm/DTMProxy.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DTMProxy.java     1999/12/13 07:46:58     1.3
  +++ DTMProxy.java     1999/12/16 09:06:05     1.4
  @@ -77,6 +77,13 @@
     int node;
   
     /** Create a DTMProxy Node representing a specific Node in a DTM */
  +  DTMProxy(DTM dtm,int node,int type)
  +  {
  +    this.dtm=dtm;
  +    this.node=node;
  +  }
  +
  +  /** Create a DTMProxy Node representing a specific Node in a DTM */
     DTMProxy(DTM dtm,int node)
     {
       this.dtm=dtm;
  @@ -86,17 +93,17 @@
     /** Create a DTMProxy Node representing the Document Node in a DTM */
     DTMProxy(DTM dtm)
     {
  -    this(dtm,0);
  +    this(dtm,0, Node.DOCUMENT_NODE);
     }
     
     /** NON-DOM: Return the DTM model */
  -  public DTM getDTM()
  +  public final DTM getDTM()
     {
       return dtm;
     }
     
     /** NON-DOM: Return the DTM node number */
  -  public int getDTMNodeNumber()
  +  public final int getDTMNodeNumber()
     {
       return node;
     }
  @@ -104,7 +111,7 @@
     /**
      * Test for equality based on node number.
      */
  -  public boolean equals(Node node)
  +  public final boolean equals(Node node)
     {
       try
       {
  @@ -120,7 +127,7 @@
     /**
      * Test for equality based on node number.
      */
  -  public boolean equals(Object node)
  +  public final boolean equals(Object node)
     {
       try
       {
  @@ -134,7 +141,7 @@
     }
   
     /** FUTURE DOM: Test node identity, in lieu of Node==Node */
  -  public boolean sameNodeAs(Node other)
  +  public final boolean sameNodeAs(Node other)
     {
       if(! (other instanceof DTMProxy) )
         return false;
  @@ -143,7 +150,7 @@
     }
     
     /** @see org.w3c.dom.Node */
  -  public String             getNodeName()
  +  public final String             getNodeName()
     {
       return dtm.getNodeName(node);
     }
  @@ -159,31 +166,31 @@
      * <p>
      * Note that getNodeName is aliased to getTarget.
      */
  -  public String getTarget() 
  +  public final String getTarget() 
     {
       return dtm.getNodeName(node);
     } // getTarget():String
     
     /** @see org.w3c.dom.Node as of DOM Level 2*/
  -  public String             getLocalName()
  +  public final String             getLocalName()
     {
       return dtm.getLocalName(node);
     }
     
     /** @see org.w3c.dom.Node as of DOM Level 2*/
  -  public String             getPrefix()
  +  public final String             getPrefix()
     {
       return dtm.getPrefix(node);
     }
     
     /** @see org.w3c.dom.Node as of DOM Level 2*/
  -  public String             getNamespaceURI()
  +  public final String             getNamespaceURI()
     {
       return dtm.getNamespaceURI(node);
     }
     
     /** @see org.w3c.dom.Node */
  -  public String  getNodeValue()                                              
   
  +  public final String  getNodeValue()                                        
         
       throws DOMException
     {
       // ***** ASSUMPTION: ATTRIBUTES HAVE SINGLE TEXT-NODE CHILD.
  @@ -195,54 +202,56 @@
     }
   
     /** @see org.w3c.dom.Node -- DTMProxy is read-only */
  -  public void               setNodeValue(String nodeValue)
  +  public final void               setNodeValue(String nodeValue)
       throws DOMException
     {
       throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR);
     }
   
     /** @see org.w3c.dom.Node */
  -  public short              getNodeType()
  +  public final short              getNodeType()
     {
       return (short) dtm.getNodeType(node);
     }
     
     /** @see org.w3c.dom.Node */
  -  public Node               getParentNode()
  +  public final Node               getParentNode()
     {
  +    if(getNodeType() == Node.ATTRIBUTE_NODE)
  +      return null;
       int newnode=dtm.getParent(node);
       return (newnode==-1) ? null : dtm.getNode(newnode);
     }
   
     /** @see org.w3c.dom.Node */
  -  public NodeList           getChildNodes()
  +  public final NodeList           getChildNodes()
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
     
     /** @see org.w3c.dom.Node */
  -  public Node               getFirstChild()
  +  public final Node               getFirstChild()
     {
       int newnode=dtm.getFirstChild(node);
       return (newnode==-1) ? null : dtm.getNode(newnode);
     }
     
     /** @see org.w3c.dom.Node */
  -  public Node               getLastChild()
  +  public final Node               getLastChild()
     {
       int newnode=dtm.getLastChild(node);
       return (newnode==-1) ? null : dtm.getNode(newnode);
     }
     
     /** @see org.w3c.dom.Node */
  -  public Node               getPreviousSibling()
  +  public final Node               getPreviousSibling()
     {
       int newnode=dtm.getPreviousSibling(node);
       return (newnode==-1) ? null : dtm.getNode(newnode);
     }
     
     /** @see org.w3c.dom.Node */
  -  public Node               getNextSibling()
  +  public final Node               getNextSibling()
     {
       // Attr's Next is defined at DTM level, but not at DOM level.
       if(dtm.getNodeType(node)==Node.ATTRIBUTE_NODE)
  @@ -252,19 +261,19 @@
     }
   
     /** @see org.w3c.dom.Node */
  -  public NamedNodeMap       getAttributes()
  +  public final NamedNodeMap       getAttributes()
     {
       return new DTMProxyMap(dtm,node);
     }
   
     /** @see org.w3c.dom.Node */
  -  public Document           getOwnerDocument()
  +  public final Document           getOwnerDocument()
     {
       return dtm.getDocument();
     }
     
     /** @see org.w3c.dom.Node -- DTMProxy is read-only */
  -  public Node               insertBefore(Node newChild, 
  +  public final Node               insertBefore(Node newChild, 
                                            Node refChild)
       throws DOMException
     {
  @@ -272,7 +281,7 @@
     }
   
     /** @see org.w3c.dom.Node -- DTMProxy is read-only */
  -  public Node               replaceChild(Node newChild, 
  +  public final Node               replaceChild(Node newChild, 
                                            Node oldChild)
       throws DOMException
     {
  @@ -280,83 +289,83 @@
     }
   
     /** @see org.w3c.dom.Node -- DTMProxy is read-only */
  -  public Node               removeChild(Node oldChild)
  +  public final Node               removeChild(Node oldChild)
       throws DOMException
     {
       throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR);
     }
   
     /** @see org.w3c.dom.Node -- DTMProxy is read-only */
  -  public Node               appendChild(Node newChild)
  +  public final Node               appendChild(Node newChild)
       throws DOMException
     {
       throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR);
     }
   
     /** @see org.w3c.dom.Node */
  -  public boolean            hasChildNodes()
  +  public final boolean            hasChildNodes()
     {
       return (-1 != dtm.getFirstChild(node));
     }
     
     /** @see org.w3c.dom.Node -- DTMProxy is read-only */
  -  public Node               cloneNode(boolean deep)
  +  public final Node               cloneNode(boolean deep)
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
     
     /** @see org.w3c.dom.Document */
  -  public DocumentType       getDoctype()
  +  public final DocumentType       getDoctype()
     {
       return null;
     }
   
     /** @see org.w3c.dom.Document */
  -  public DOMImplementation  getImplementation()
  +  public final DOMImplementation  getImplementation()
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Document */
  -  public Element            getDocumentElement()
  +  public final Element            getDocumentElement()
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Document */
  -  public Element            createElement(String tagName)
  +  public final Element            createElement(String tagName)
       throws DOMException
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Document */
  -  public DocumentFragment   createDocumentFragment()
  +  public final DocumentFragment   createDocumentFragment()
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Document */
  -  public Text               createTextNode(String data)
  +  public final Text               createTextNode(String data)
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Document */
  -  public Comment            createComment(String data)
  +  public final Comment            createComment(String data)
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Document */
  -  public CDATASection       createCDATASection(String data)
  +  public final CDATASection       createCDATASection(String data)
       throws DOMException
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Document */
  -  public ProcessingInstruction createProcessingInstruction(String target, 
  +  public final ProcessingInstruction createProcessingInstruction(String 
target, 
                                                              String data)
       throws DOMException
     {
  @@ -364,56 +373,56 @@
     }
   
     /** @see org.w3c.dom.Document */
  -  public Attr               createAttribute(String name)
  +  public final Attr               createAttribute(String name)
       throws DOMException
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Document */
  -  public EntityReference    createEntityReference(String name)
  +  public final EntityReference    createEntityReference(String name)
       throws DOMException
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Document */
  -  public NodeList           getElementsByTagName(String tagname)
  +  public final NodeList           getElementsByTagName(String tagname)
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
     
   
     /** @see org.w3c.dom.Text */
  -  public Text               splitText(int offset)
  +  public final Text               splitText(int offset)
       throws DOMException
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.CharacterData */
  -  public String             getData()
  +  public final String             getData()
       throws DOMException
     {
       return dtm.getNodeValue(node);
     }
   
     /** @see org.w3c.dom.CharacterData */
  -  public void               setData(String data)
  +  public final void               setData(String data)
       throws DOMException
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.CharacterData */
  -  public int                getLength()
  +  public final int                getLength()
     {
       // %%FIX: This should do something smarter?
       return dtm.getNodeValue(node).length();
     }
   
     /** @see org.w3c.dom.CharacterData */
  -  public String             substringData(int offset, 
  +  public final String             substringData(int offset, 
                                             int count)
       throws DOMException
     {
  @@ -421,14 +430,14 @@
     }
   
     /** @see org.w3c.dom.CharacterData */
  -  public void               appendData(String arg)
  +  public final void               appendData(String arg)
       throws DOMException
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.CharacterData */
  -  public void               insertData(int offset, 
  +  public final void               insertData(int offset, 
                                          String arg)
       throws DOMException
     {
  @@ -436,7 +445,7 @@
     }
   
     /** @see org.w3c.dom.CharacterData */
  -  public void               deleteData(int offset, 
  +  public final void               deleteData(int offset, 
                                          int count)
       throws DOMException
     {
  @@ -444,7 +453,7 @@
     }
   
     /** @see org.w3c.dom.CharacterData */
  -  public void               replaceData(int offset, 
  +  public final void               replaceData(int offset, 
                                           int count, 
                                           String arg)
       throws DOMException
  @@ -453,13 +462,13 @@
     }
     
     /** @see org.w3c.dom.Element */
  -  public String             getTagName()
  +  public final String             getTagName()
     {
       return dtm.getNodeName(node);
     }
   
     /** @see org.w3c.dom.Element */
  -  public String             getAttribute(String name)
  +  public final String             getAttribute(String name)
     { 
       DTMProxyMap  map = new DTMProxyMap(dtm, node);
       Node node = map.getNamedItem(name);
  @@ -467,7 +476,7 @@
     }
   
     /** @see org.w3c.dom.Element */
  -  public void               setAttribute(String name, 
  +  public final void               setAttribute(String name, 
                                            String value)
       throws DOMException
     {
  @@ -475,60 +484,60 @@
     }
   
     /** @see org.w3c.dom.Element */
  -  public void               removeAttribute(String name)
  +  public final void               removeAttribute(String name)
       throws DOMException
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
     
     /** @see org.w3c.dom.Element */
  -  public Attr               getAttributeNode(String name)
  +  public final Attr               getAttributeNode(String name)
     {
       DTMProxyMap  map = new DTMProxyMap(dtm, node);
       return (Attr)map.getNamedItem(name);
     }
   
     /** @see org.w3c.dom.Element */
  -  public Attr               setAttributeNode(Attr newAttr)
  +  public final Attr               setAttributeNode(Attr newAttr)
       throws DOMException
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Element */
  -  public Attr               removeAttributeNode(Attr oldAttr)
  +  public final Attr               removeAttributeNode(Attr oldAttr)
       throws DOMException
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Element */
  -  public void               normalize()
  +  public final void               normalize()
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
   
     /** @see org.w3c.dom.Attr */
  -  public String             getName()
  +  public final String             getName()
     {
       return dtm.getNodeName(node);
     }
   
     /** @see org.w3c.dom.Attr */
  -  public boolean            getSpecified()
  +  public final boolean            getSpecified()
     {
       // %%FIX
       return true;
     }
   
     /** @see org.w3c.dom.Attr */
  -  public String             getValue()
  +  public final String             getValue()
     {
       return dtm.getNodeValue(node+1);
     }
     
     /** @see org.w3c.dom.Attr */
  -  public void               setValue(String value)
  +  public final void               setValue(String value)
     {
       throw new DTMException(DTMException.NOT_SUPPORTED_ERR);
     }
  
  
  
  1.25      +1 -0      xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java
  
  Index: XSLTEngineImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- XSLTEngineImpl.java       1999/12/16 06:10:45     1.24
  +++ XSLTEngineImpl.java       1999/12/16 09:06:05     1.25
  @@ -4018,6 +4018,7 @@
       public void startDocument ()
         throws SAXException
       {
  +      m_uniqueNSValue = 0;
         m_pendingStartDoc = true;
         m_mustFlushStartDoc = false;
         // m_flistener.startDocument();
  
  
  
  1.4       +1 -1      
xml-xalan/src/org/apache/xalan/xslt/extensions/Redirect.java
  
  Index: Redirect.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/src/org/apache/xalan/xslt/extensions/Redirect.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Redirect.java     1999/11/27 08:53:26     1.3
  +++ Redirect.java     1999/12/16 09:06:06     1.4
  @@ -290,7 +290,7 @@
         }
       }
       StylesheetRoot sr = context.stylesheetTree.m_stylesheetRoot;
  -    OutputFormat formatter = sr.getNewOutputFormat();
  +    OutputFormat formatter = sr.getOutputFormat();
       
       FileOutputStream ostream = new FileOutputStream(file);
       
  
  
  

Reply via email to