You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by ig...@apache.org on 2004/02/17 01:55:05 UTC

cvs commit: xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM2.java

igorh       2004/02/16 16:55:05

  Modified:    java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM2.java
  Log:
  Fix for Bugzilla Bugs 22564 and 22808
  
  Revision  Changes    Path
  1.7       +19 -15    xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
  
  Index: SAX2DTM2.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SAX2DTM2.java	6 Sep 2003 01:15:13 -0000	1.6
  +++ SAX2DTM2.java	17 Feb 2004 00:55:05 -0000	1.7
  @@ -3281,23 +3281,27 @@
      public void copyNS(final int nodeID, SerializationHandler handler)
           throws SAXException
       {
  -      int current = nodeID;
  +      int current =  DTM.NULL; 
  +      int eType = DTM.NULL;
  +      int type = DTM.NULL;
         try{
  -          while (true)
  -          {
  -              current++;
  -              int eType = _exptype2(current);
  -              int type = _exptype2Type(eType);
  -         
  -              if (type == DTM.ATTRIBUTE_NODE) {
  -                 continue;
  +        for (int elementID = nodeID; elementID != DTM.ROOT_NODE; elementID = _parent2(elementID)){
  +              current =  elementID;    
  +              while (true){
  +                  current++;
  +                  eType = _exptype2(current);
  +                  type = _exptype2Type(eType);
  +             
  +                  if (type == DTM.ATTRIBUTE_NODE) {
  +                     continue;
  +                  }
  +                  else if (type == DTM.NAMESPACE_NODE) {
  +                      handler.startPrefixMapping(getNodeNameX(makeNodeHandle(current)), getNodeValue(makeNodeHandle(current)), false);                       
  +                  }
  +                  else
  +                      break;
  +                  }
                 }
  -              else if (type == DTM.NAMESPACE_NODE) {
  -                  handler.namespaceAfterStartElement(getNodeNameX(makeNodeHandle(current)), getNodeValue(makeNodeHandle(current)));            
  -              }
  -              else
  -                  break;
  -                        }
           }catch (Exception e) {
               throw new SAXException(e);
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org