sboag       01/06/21 21:38:06

  Modified:    java/src/org/apache/xml/dtm/ref DTMManagerDefault.java
  Log:
  In getDTMHandleFromNode, if a DTM has to be created, create
  it from the ownerDocument instead of the node argument.  I think
  this will avoid a lot of problems with node identity coming from
  extensions.
  
  Revision  Changes    Path
  1.10      +17 -14    
xml-xalan/java/src/org/apache/xml/dtm/ref/DTMManagerDefault.java
  
  Index: DTMManagerDefault.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMManagerDefault.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DTMManagerDefault.java    2001/06/21 23:46:44     1.9
  +++ DTMManagerDefault.java    2001/06/22 04:38:04     1.10
  @@ -267,18 +267,18 @@
             {
               // CoroutineSAXParser_Xerces to avoid threading.
               // System.out.println("Using CoroutineSAXParser_Xerces to avoid 
threading");
  -         try {
  -           // should be ok, it's in the same package - no need for thread 
class loader
  -           Class c=Class.forName( 
"org.apache.xml.dtm.ref.CoroutineSAXParser_Xerces" );
  -           coParser=(CoroutineParser)c.newInstance();
  -           coParser.init( coroutineManager, appCoroutine, reader );
  -         }  catch( Exception ex ) {
  -           ex.printStackTrace();
  -           coParser=null;
  -         }
  +            try {
  +              // should be ok, it's in the same package - no need for thread 
class loader
  +              Class c=Class.forName( 
"org.apache.xml.dtm.ref.CoroutineSAXParser_Xerces" );
  +              coParser=(CoroutineParser)c.newInstance();
  +              coParser.init( coroutineManager, appCoroutine, reader );
  +            }  catch( Exception ex ) {
  +              ex.printStackTrace();
  +              coParser=null;
  +            }
             }
   
  -       if( coParser==null ) {
  +          if( coParser==null ) {
               // Create a CoroutineSAXParser that will run on the secondary 
thread.
               if (null == reader)
                 coParser = new CoroutineSAXParser(coroutineManager,
  @@ -452,12 +452,15 @@
            }
         
         // Fallback: Not found in one we know how to search.
  -      // Current solution: Generate a new DOM2DTM with this node as root.
  -      // %REVIEW% Maybe the best I can do??
  -      DTM dtm = getDTM(new javax.xml.transform.dom.DOMSource(node), false,
  +      // Current solution: Generate a new DOM2DTM.
  +      // %REVIEW% Maybe the best I can do??     
  +      Node root = node.getOwnerDocument();
  +      if(null == root)
  +        root =  node;   
  +      DTM dtm = getDTM(new javax.xml.transform.dom.DOMSource(root), false,
                          null, true, true);
   
  -      return dtm.getDocument();
  +      return ((DOM2DTM)dtm).getHandleOfNode(node);
       }
     }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to