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

cvs commit: xml-xalan/java/src/org/apache/xpath/functions FuncDoclocation.java

sboag       01/05/16 16:29:11

  Modified:    java/src/org/apache/xalan/templates Tag: DTM_EXP
                        FuncDocument.java
               java/src/org/apache/xalan/transformer Tag: DTM_EXP
                        TransformerHandlerImpl.java TransformerImpl.java
               java/src/org/apache/xml/dtm Tag: DTM_EXP
                        CoroutineManager.java DTM.java DTMDefaultBase.java
                        DTMDocumentImpl.java
               java/src/org/apache/xml/dtm/sax2dtm Tag: DTM_EXP
                        SAX2DTM.java
               java/src/org/apache/xpath/functions Tag: DTM_EXP
                        FuncDoclocation.java
  Log:
  TransformerHandler now works perfectly.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.19.2.5  +1 -1      xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java
  
  Index: FuncDocument.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java,v
  retrieving revision 1.19.2.4
  retrieving revision 1.19.2.5
  diff -u -r1.19.2.4 -r1.19.2.5
  --- FuncDocument.java	2001/05/10 20:48:15	1.19.2.4
  +++ FuncDocument.java	2001/05/16 23:28:29	1.19.2.5
  @@ -150,7 +150,7 @@
             warn(xctxt, XSLTErrorResources.WG_EMPTY_SECOND_ARG, null);
           
           DTM baseDTM = xctxt.getDTM(baseNode);
  -        base = baseDTM.getDocumentBaseURI(baseNode);
  +        base = baseDTM.getDocumentBaseURI();
   
   //        int baseDoc = baseDTM.getDocument();
   //
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +267 -11   xml-xalan/java/src/org/apache/xalan/transformer/Attic/TransformerHandlerImpl.java
  
  Index: TransformerHandlerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/Attic/TransformerHandlerImpl.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- TransformerHandlerImpl.java	2001/05/16 15:13:54	1.1.2.2
  +++ TransformerHandlerImpl.java	2001/05/16 23:28:38	1.1.2.3
  @@ -67,6 +67,7 @@
   import org.xml.sax.DTDHandler;
   import org.xml.sax.ContentHandler;
   import org.xml.sax.ErrorHandler;
  +import org.xml.sax.ext.DeclHandler;
   import org.xml.sax.SAXException;
   import org.xml.sax.SAXParseException;
   import org.xml.sax.SAXNotSupportedException;
  @@ -79,10 +80,13 @@
   import javax.xml.transform.Result;
   
   import org.apache.xpath.XPathContext;
  -
   import org.apache.xml.dtm.DTM;
   import org.apache.xml.dtm.DTMManager;
   
  +import org.apache.xml.dtm.CoroutineManager;
  +import org.apache.xml.dtm.CoroutineSAXParser;
  +import org.apache.xml.dtm.sax2dtm.SAX2DTM;
  +
   /**
    * A TransformerHandler
    * listens for SAX ContentHandler parse events and transforms
  @@ -90,8 +94,10 @@
    */
   public class TransformerHandlerImpl
           implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler,
  -                   LexicalHandler, TransformerHandler
  +                   LexicalHandler, TransformerHandler, DeclHandler
   {
  +  
  +  private boolean m_insideParse = false;
   
     ////////////////////////////////////////////////////////////////////
     // Constructors.
  @@ -112,16 +118,50 @@
   
       m_transformer = transformer;
       m_baseSystemID = baseSystemID;
  -    
  +
       XPathContext xctxt = transformer.getXPathContext();
       DTM dtm = xctxt.getDTM(null, true, transformer, true);
       
  +    m_dtm = dtm;
  +    dtm.setDocumentBaseURI(baseSystemID);
  +
       m_contentHandler = dtm.getContentHandler();
       m_dtdHandler = dtm.getDTDHandler();
       m_entityResolver = dtm.getEntityResolver();
       m_errorHandler = dtm.getErrorHandler();
       m_lexicalHandler = dtm.getLexicalHandler();
     }
  +  
  +  /** 
  +   * Do what needs to be done to shut down the CoRoutine management.
  +   */
  +  protected void clearCoRoutine()
  +  {
  +    
  +    if(m_dtm instanceof SAX2DTM)
  +    {
  +      if(DEBUG)
  +        System.out.println("In clearCoRoutine...");
  +      SAX2DTM sax2dtm = ((SAX2DTM)m_dtm);
  +      if(null != m_contentHandler 
  +         && m_contentHandler instanceof CoroutineSAXParser)
  +      {
  +        CoroutineSAXParser sp = (CoroutineSAXParser)m_contentHandler;
  +
  +        if(m_insideParse)
  +            sp.doMore(false, sax2dtm.getAppCoroutineID());      
  +      }
  +      
  +      sax2dtm.clearCoRoutine(true);
  +      m_contentHandler = null;
  +      m_dtdHandler = null;
  +      m_entityResolver = null;
  +      m_errorHandler = null;
  +      m_lexicalHandler = null;
  +      if(DEBUG)
  +        System.out.println("...exiting clearCoRoutine");
  +    }
  +  }
   
     ////////////////////////////////////////////////////////////////////
     // Implementation of javax.xml.transform.sax.TransformerHandler.
  @@ -138,14 +178,17 @@
     public void setResult(Result result) throws IllegalArgumentException
     {
   
  -    if(null == result)
  +    if (null == result)
         throw new IllegalArgumentException("result should not be null");
  +
       try
       {
  -      ContentHandler handler = m_transformer.createResultContentHandler(result);
  -      m_transformer.setContentHandler(handler); 
  +      ContentHandler handler =
  +        m_transformer.createResultContentHandler(result);
  +
  +      m_transformer.setContentHandler(handler);
       }
  -    catch(javax.xml.transform.TransformerException te)
  +    catch (javax.xml.transform.TransformerException te)
       {
         throw new IllegalArgumentException("result could not be set");
       }
  @@ -161,6 +204,7 @@
     public void setSystemId(String systemID)
     {
       m_baseSystemID = systemID;
  +    m_dtm.setDocumentBaseURI(systemID);
     }
   
     /**
  @@ -276,7 +320,16 @@
     public void setDocumentLocator(Locator locator)
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#setDocumentLocator: "
  +                         + locator.getSystemId());
  +
       this.m_locator = locator;
  +    
  +    if(null == m_baseSystemID)
  +    {
  +      setSystemId(locator.getSystemId());
  +    }
   
       if (m_contentHandler != null)
       {
  @@ -293,8 +346,14 @@
      */
     public void startDocument() throws SAXException
     {
  +
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#startDocument");
  +      
  +    m_insideParse = true;
   
  -    Thread listener=new Thread(m_transformer);
  +    Thread listener = new Thread(m_transformer);
  +
       m_transformer.setTransformThread(listener);
       listener.setDaemon(false);
       listener.start();
  @@ -315,6 +374,11 @@
     public void endDocument() throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#endDocument");
  +
  +    m_insideParse = false;
  +    
       if (m_contentHandler != null)
       {
         m_contentHandler.endDocument();
  @@ -329,17 +393,19 @@
   
           // This should wait until the transformThread is considered not alive.
           transformThread.join();
  -        if(!m_transformer.hasTransformThreadErrorCatcher())
  +
  +        if (!m_transformer.hasTransformThreadErrorCatcher())
           {
             Exception e = m_transformer.getExceptionThrown();
  -          if(null != e)
  +
  +          if (null != e)
               throw new org.xml.sax.SAXException(e);
           }
  +
           m_transformer.setTransformThread(null);
         }
         catch (InterruptedException ie){}
       }
  -
     }
   
     /**
  @@ -355,6 +421,10 @@
             throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#startPrefixMapping: "
  +                         + prefix + ", " + uri);
  +
       if (m_contentHandler != null)
       {
         m_contentHandler.startPrefixMapping(prefix, uri);
  @@ -372,6 +442,10 @@
     public void endPrefixMapping(String prefix) throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#endPrefixMapping: "
  +                         + prefix);
  +
       if (m_contentHandler != null)
       {
         m_contentHandler.endPrefixMapping(prefix);
  @@ -395,6 +469,9 @@
               throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#startElement: " + qName);
  +
       if (m_contentHandler != null)
       {
         m_contentHandler.startElement(uri, localName, qName, atts);
  @@ -416,6 +493,9 @@
             throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#endElement: " + qName);
  +
       if (m_contentHandler != null)
       {
         m_contentHandler.endElement(uri, localName, qName);
  @@ -435,6 +515,10 @@
     public void characters(char ch[], int start, int length) throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#characters: " + start + ", "
  +                         + length);
  +
       if (m_contentHandler != null)
       {
         m_contentHandler.characters(ch, start, length);
  @@ -455,6 +539,10 @@
             throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#ignorableWhitespace: "
  +                         + start + ", " + length);
  +
       if (m_contentHandler != null)
       {
         m_contentHandler.ignorableWhitespace(ch, start, length);
  @@ -474,6 +562,10 @@
             throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#processingInstruction: "
  +                         + target + ", " + data);
  +
       if (m_contentHandler != null)
       {
         m_contentHandler.processingInstruction(target, data);
  @@ -491,6 +583,9 @@
     public void skippedEntity(String name) throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#skippedEntity: " + name);
  +
       if (m_contentHandler != null)
       {
         m_contentHandler.skippedEntity(name);
  @@ -512,6 +607,9 @@
     public void warning(SAXParseException e) throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#warning: " + e);
  +
       if (m_errorHandler != null)
       {
         m_errorHandler.warning(e);
  @@ -529,6 +627,9 @@
     public void error(SAXParseException e) throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#error: " + e);
  +
       if (m_errorHandler != null)
       {
         m_errorHandler.error(e);
  @@ -546,6 +647,9 @@
     public void fatalError(SAXParseException e) throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#fatalError: " + e);
  +
       if (m_errorHandler != null)
       {
         m_errorHandler.fatalError(e);
  @@ -581,6 +685,10 @@
             throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#startDTD: " + name + ", "
  +                         + publicId + ", " + systemId);
  +
       if (null != m_lexicalHandler)
       {
         m_lexicalHandler.startDTD(name, publicId, systemId);
  @@ -596,6 +704,9 @@
     public void endDTD() throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#endDTD");
  +
       if (null != m_lexicalHandler)
       {
         m_lexicalHandler.endDTD();
  @@ -627,6 +738,9 @@
     public void startEntity(String name) throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#startEntity: " + name);
  +
       if (null != m_lexicalHandler)
       {
         m_lexicalHandler.startEntity(name);
  @@ -643,6 +757,9 @@
     public void endEntity(String name) throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#endEntity: " + name);
  +
       if (null != m_lexicalHandler)
       {
         m_lexicalHandler.endEntity(name);
  @@ -662,6 +779,9 @@
     public void startCDATA() throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#startCDATA");
  +
       if (null != m_lexicalHandler)
       {
         m_lexicalHandler.startCDATA();
  @@ -677,6 +797,9 @@
     public void endCDATA() throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#endCDATA");
  +
       if (null != m_lexicalHandler)
       {
         m_lexicalHandler.endCDATA();
  @@ -698,6 +821,10 @@
     public void comment(char ch[], int start, int length) throws SAXException
     {
   
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#comment: " + start + ", "
  +                         + length);
  +
       if (null != m_lexicalHandler)
       {
         m_lexicalHandler.comment(ch, start, length);
  @@ -705,9 +832,132 @@
     }
   
     ////////////////////////////////////////////////////////////////////
  +  // Implementation of org.xml.sax.ext.DeclHandler.
  +  ////////////////////////////////////////////////////////////////////
  +
  +  /**
  +   * Report an element type declaration.
  +   *
  +   * <p>The content model will consist of the string "EMPTY", the
  +   * string "ANY", or a parenthesised group, optionally followed
  +   * by an occurrence indicator.  The model will be normalized so
  +   * that all whitespace is removed,and will include the enclosing
  +   * parentheses.</p>
  +   *
  +   * @param name The element type name.
  +   * @param model The content model as a normalized string.
  +   * @throws SAXException The application may raise an exception.
  +   */
  +  public void elementDecl(String name, String model) throws SAXException
  +  {
  +
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#elementDecl: " + name + ", "
  +                         + model);
  +
  +    if (null != m_declHandler)
  +    {
  +      m_declHandler.elementDecl(name, model);
  +    }
  +  }
  +
  +  /**
  +   * Report an attribute type declaration.
  +   *
  +   * <p>Only the effective (first) declaration for an attribute will
  +   * be reported.  The type will be one of the strings "CDATA",
  +   * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
  +   * "ENTITIES", or "NOTATION", or a parenthesized token group with
  +   * the separator "|" and all whitespace removed.</p>
  +   *
  +   * @param eName The name of the associated element.
  +   * @param aName The name of the attribute.
  +   * @param type A string representing the attribute type.
  +   * @param valueDefault A string representing the attribute default
  +   *        ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
  +   *        none of these applies.
  +   * @param value A string representing the attribute's default value,
  +   *        or null if there is none.
  +   * @throws SAXException The application may raise an exception.
  +   */
  +  public void attributeDecl(
  +          String eName, String aName, String type, String valueDefault, String value)
  +            throws SAXException
  +  {
  +
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#attributeDecl: " + eName
  +                         + ", " + aName + ", etc...");
  +
  +    if (null != m_declHandler)
  +    {
  +      m_declHandler.attributeDecl(eName, aName, type, valueDefault, value);
  +    }
  +  }
  +
  +  /**
  +   * Report an internal entity declaration.
  +   *
  +   * <p>Only the effective (first) declaration for each entity
  +   * will be reported.</p>
  +   *
  +   * @param name The name of the entity.  If it is a parameter
  +   *        entity, the name will begin with '%'.
  +   * @param value The replacement text of the entity.
  +   * @throws SAXException The application may raise an exception.
  +   * @see #externalEntityDecl
  +   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
  +   */
  +  public void internalEntityDecl(String name, String value)
  +          throws SAXException
  +  {
  +
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#internalEntityDecl: " + name
  +                         + ", " + value);
  +
  +    if (null != m_declHandler)
  +    {
  +      m_declHandler.internalEntityDecl(name, value);
  +    }
  +  }
  +
  +  /**
  +   * Report a parsed external entity declaration.
  +   *
  +   * <p>Only the effective (first) declaration for each entity
  +   * will be reported.</p>
  +   *
  +   * @param name The name of the entity.  If it is a parameter
  +   *        entity, the name will begin with '%'.
  +   * @param publicId The declared public identifier of the entity, or
  +   *        null if none was declared.
  +   * @param systemId The declared system identifier of the entity.
  +   * @throws SAXException The application may raise an exception.
  +   * @see #internalEntityDecl
  +   * @see org.xml.sax.DTDHandler#unparsedEntityDecl
  +   */
  +  public void externalEntityDecl(
  +          String name, String publicId, String systemId) throws SAXException
  +  {
  +
  +    if (DEBUG)
  +      System.out.println("TransformerHandlerImpl#externalEntityDecl: " + name
  +                         + ", " + publicId + ", " + systemId);
  +
  +    if (null != m_declHandler)
  +    {
  +      m_declHandler.externalEntityDecl(name, publicId, systemId);
  +    }
  +  }
  +
  +  ////////////////////////////////////////////////////////////////////
     // Internal state.
     ////////////////////////////////////////////////////////////////////
   
  +  /** Set to true for diagnostics output.         */
  +  private static boolean DEBUG = false;
  +
     /**
      * The transformer this will use to transform a
      * source tree into a result tree.
  @@ -737,4 +987,10 @@
   
     /** The lexical handler to aggregate to. */
     private LexicalHandler m_lexicalHandler = null;
  +
  +  /** The decl handler to aggregate to. */
  +  private DeclHandler m_declHandler = null;
  +  
  +  /** The Document Table Instance we are transforming. */
  +  DTM m_dtm;
   }
  
  
  
  1.90.2.10 +10 -3     xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java
  
  Index: TransformerImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java,v
  retrieving revision 1.90.2.9
  retrieving revision 1.90.2.10
  diff -u -r1.90.2.9 -r1.90.2.10
  --- TransformerImpl.java	2001/05/16 15:14:01	1.90.2.9
  +++ TransformerImpl.java	2001/05/16 23:28:39	1.90.2.10
  @@ -429,7 +429,7 @@
         m_xmlSource = null;
         m_doc = DTM.NULL;
         m_isTransformDone = false;
  -      m_inputContentHandler = null;
  +      // m_inputContentHandler = null;
         
         // For now, reset the document cache each time.
         getXPathContext().getSourceTreeManager().reset();
  @@ -1169,6 +1169,8 @@
   
       if (null == m_inputContentHandler)
       {
  +      //      if(null == m_urlOfSource && null != m_stylesheetRoot)
  +      //        m_urlOfSource = m_stylesheetRoot.getBaseIdentifier();
         m_inputContentHandler = new TransformerHandlerImpl(this, doDocFrag, m_urlOfSource);
       }
   
  @@ -2858,10 +2860,15 @@
         {
           m_isTransformDone = true;
   
  -        synchronized (this)
  +        if(m_inputContentHandler instanceof TransformerHandlerImpl)
           {
  -          notifyAll();
  +          ((TransformerHandlerImpl)m_inputContentHandler).clearCoRoutine();
           }
  +
  +//        synchronized (this)
  +//        {
  +//          notifyAll();
  +//        }
         }
       }
       catch (Exception e)
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.7   +38 -37    xml-xalan/java/src/org/apache/xml/dtm/Attic/CoroutineManager.java
  
  Index: CoroutineManager.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/Attic/CoroutineManager.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- CoroutineManager.java	2001/04/22 22:08:27	1.1.2.6
  +++ CoroutineManager.java	2001/05/16 23:28:45	1.1.2.7
  @@ -217,23 +217,23 @@
     {
       if(coroutineID>=0)
         {
  -	if(coroutineID>=m_unreasonableId || m_activeIDs.get(coroutineID))
  -	  return -1;
  +        if(coroutineID>=m_unreasonableId || m_activeIDs.get(coroutineID))
  +          return -1;
         }
       else
         {
  -	// What I want is "Find first clear bit". That doesn't exist.
  -	// JDK1.2 added "find last set bit", but that doesn't help now.
  -	coroutineID=0;
  -	while(coroutineID<m_unreasonableId)
  -	  {
  -	    if(m_activeIDs.get(coroutineID))
  -	      ++coroutineID;
  -	    else
  -	      break;
  -	  }
  -	if(coroutineID>=m_unreasonableId)
  -	  return -1;
  +        // What I want is "Find first clear bit". That doesn't exist.
  +        // JDK1.2 added "find last set bit", but that doesn't help now.
  +        coroutineID=0;
  +        while(coroutineID<m_unreasonableId)
  +          {
  +            if(m_activeIDs.get(coroutineID))
  +              ++coroutineID;
  +            else
  +              break;
  +          }
  +        if(coroutineID>=m_unreasonableId)
  +          return -1;
         }
   
       m_activeIDs.set(coroutineID);
  @@ -262,15 +262,15 @@
   
       while(m_nextCoroutine != thisCoroutine)
         {
  -	try 
  -	  {
  -	    wait();
  -	  }
  -	catch(java.lang.InterruptedException e)
  -	  {
  -	    // %TBD% -- Declare? Encapsulate? Ignore? Or
  -	    // dance widdershins about the instruction cache?
  -	  }
  +        try 
  +          {
  +            wait();
  +          }
  +        catch(java.lang.InterruptedException e)
  +          {
  +            // %TBD% -- Declare? Encapsulate? Ignore? Or
  +            // dance widdershins about the instruction cache?
  +          }
         }
       
       return m_yield;
  @@ -303,24 +303,25 @@
       notify();
       while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY)
         {
  -	try 
  -	  {
  -	    wait();
  -	  }
  -	catch(java.lang.InterruptedException e)
  -	  {
  -	    // %TBD% -- Declare? Encapsulate? Ignore? Or
  -	    // dance deasil about the program counter?
  -	  }
  +        try 
  +          {
  +            // System.out.println("waiting...");
  +            wait();
  +          }
  +        catch(java.lang.InterruptedException e)
  +          {
  +            // %TBD% -- Declare? Encapsulate? Ignore? Or
  +            // dance deasil about the program counter?
  +          }
         }
   
       if(m_nextCoroutine==NOBODY)
         {
  -	// Pass it along
  -	co_exit(thisCoroutine);
  -	// And inform this coroutine that its partners are Going Away
  -	// %REVIEW% Should this throw/return something more useful?
  -	throw new java.lang.NoSuchMethodException("CoroutineManager recieved co_exit() request");
  +        // Pass it along
  +        co_exit(thisCoroutine);
  +        // And inform this coroutine that its partners are Going Away
  +        // %REVIEW% Should this throw/return something more useful?
  +        throw new java.lang.NoSuchMethodException("CoroutineManager recieved co_exit() request");
         }
       
       return m_yield;
  
  
  
  1.1.2.14  +13 -14    xml-xalan/java/src/org/apache/xml/dtm/Attic/DTM.java
  
  Index: DTM.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/Attic/DTM.java,v
  retrieving revision 1.1.2.13
  retrieving revision 1.1.2.14
  diff -u -r1.1.2.13 -r1.1.2.14
  --- DTM.java	2001/05/16 05:33:20	1.1.2.13
  +++ DTM.java	2001/05/16 23:28:47	1.1.2.14
  @@ -500,22 +500,21 @@
     public boolean isSupported(String feature, 
                                String version);
     
  -  /** Return the base URI of the specified node's Document node. If it
  -   * is not known (because the document was parsed from a socket
  -   * connection or from standard input, for example), the value of
  -   * this property is null.  If you need the document's base URI, you
  -   * can retrieve the Document node and then ask it this question.
  +  /**
  +   * Return the base URI of the document entity. If it is not known
  +   * (because the document was parsed from a socket connection or from
  +   * standard input, for example), the value of this property is unknown.
      *
  -   * %REVIEW% Should this the base URI at the specified node instead?
  -   * (The Document's base URI may not match that of other nodes,
  -   * due to External Parsed Entities and <xml:base/>. Supporting that
  -   * would require tagging nodes with their base URI, or reintroducing
  -   * EntityReference boundary points.
  -   *
  -   * @param nodeHandle The node id, which can be any valid node handle.
      * @return the document base URI String object or null if unknown.
  -   * */
  -  public String getDocumentBaseURI(int nodeHandle);
  +   */
  +  public String getDocumentBaseURI();
  +  
  +  /**
  +   * Set the base URI of the document entity.
  +   *
  +   * @param baseURI the document base URI String object or null if unknown.
  +   */
  +  public void setDocumentBaseURI(String baseURI);
   
     /**
      * Return the system identifier of the document entity. If
  
  
  
  1.1.2.5   +13 -52    xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMDefaultBase.java
  
  Index: DTMDefaultBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMDefaultBase.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- DTMDefaultBase.java	2001/05/16 05:33:20	1.1.2.4
  +++ DTMDefaultBase.java	2001/05/16 23:28:48	1.1.2.5
  @@ -806,55 +806,6 @@
     }
   
     /**
  -   * Given a node handle, advance to its next descendant.
  -   * If not yet resolved, waits for more nodes to be added to the document and
  -   * tries again.
  -   *
  -   * @param subtreeRootNodeHandle
  -   *
  -   * NEEDSDOC @param subtreeRootHandle
  -   * @param nodeHandle int Handle of the node.
  -   * @return handle of next descendant,
  -   * or DTM.NULL to indicate none exists.
  -   */
  -  public int getNextDescendant(int subtreeRootHandle, int nodeHandle)
  -  {
  -
  -    // %TBD%
  -    return 0;
  -  }
  -
  -  /**
  -   * Given a node handle, advance to the next node on the following axis.
  -   *
  -   * @param axisContextHandle the start of the axis that is being traversed.
  -   * @param nodeHandle
  -   * @return handle of next sibling,
  -   * or DTM.NULL to indicate none exists.
  -   */
  -  public int getNextFollowing(int axisContextHandle, int nodeHandle)
  -  {
  -
  -    // %TBD%
  -    return 0;
  -  }
  -
  -  /**
  -   * Given a node handle, advance to the next node on the preceding axis.
  -   *
  -   * @param axisContextHandle the start of the axis that is being traversed.
  -   * @param nodeHandle the id of the node.
  -   * @return int Node-number of preceding sibling,
  -   * or DTM.NULL to indicate none exists.
  -   */
  -  public int getNextPreceding(int axisContextHandle, int nodeHandle)
  -  {
  -
  -    // %TBD%
  -    return 0;
  -  }
  -
  -  /**
      * Given a node handle, find its parent node.
      *
      * @param nodeHandle the id of the node.
  @@ -1172,15 +1123,25 @@
      * (because the document was parsed from a socket connection or from
      * standard input, for example), the value of this property is unknown.
      *
  -   * @param nodeHandle The node id, which can be any valid node handle.
      * @return the document base URI String object or null if unknown.
      */
  -  public String getDocumentBaseURI(int nodeHandle)
  +  public String getDocumentBaseURI()
     {
   
  -    // %REVIEW%  OK? -sb
       return m_documentBaseURI;
     }
  +  
  +  /**
  +   * Set the base URI of the document entity.
  +   *
  +   * @param baseURI the document base URI String object or null if unknown.
  +   */
  +  public void setDocumentBaseURI(String baseURI)
  +  {
  +
  +    m_documentBaseURI = baseURI;
  +  }
  +
   
     /**
      * Return the system identifier of the document entity. If
  
  
  
  1.1.2.17  +21 -5     xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMDocumentImpl.java
  
  Index: DTMDocumentImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/Attic/DTMDocumentImpl.java,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- DTMDocumentImpl.java	2001/05/16 05:33:20	1.1.2.16
  +++ DTMDocumentImpl.java	2001/05/16 23:28:49	1.1.2.17
  @@ -126,6 +126,9 @@
           boolean m_isError = false;
   
           private final boolean DEBUG = false;
  +        
  +        /** The document base URI. */
  +        protected String m_documentBaseURI;
   
     /** If we're building the model incrementally on demand, we need to
      * be able to tell the source when to send us more data.
  @@ -1795,19 +1798,32 @@
            * @return Returns <code>true</code> if the specified feature is
            *   supported on this node, <code>false</code> otherwise.
            */
  -        public boolean isSupported(String feature,
  -                                                                                                                 String version) {return false;}
  +        public boolean isSupported(String feature, String version) {return false;}
   
           /**
            * Return the base URI of the document entity. If it is not known
            * (because the document was parsed from a socket connection or from
            * standard input, for example), the value of this property is unknown.
            *
  -         * @param nodeHandle The node id, which can be any valid node handle.
            * @return the document base URI String object or null if unknown.
            */
  -        public String getDocumentBaseURI(int nodeHandle) {return null;}
  -
  +        public String getDocumentBaseURI()
  +        {
  +      
  +          return m_documentBaseURI;
  +        }
  +        
  +        /**
  +         * Set the base URI of the document entity.
  +         *
  +         * @param baseURI the document base URI String object or null if unknown.
  +         */
  +        public void setDocumentBaseURI(String baseURI)
  +        {
  +      
  +          m_documentBaseURI = baseURI;
  +        }
  +        
           /**
            * Return the system identifier of the document entity. If
            * it is not known, the value of this property is unknown.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.12  +11 -3     xml-xalan/java/src/org/apache/xml/dtm/sax2dtm/Attic/SAX2DTM.java
  
  Index: SAX2DTM.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/sax2dtm/Attic/SAX2DTM.java,v
  retrieving revision 1.1.2.11
  retrieving revision 1.1.2.12
  diff -u -r1.1.2.11 -r1.1.2.12
  --- SAX2DTM.java	2001/05/16 05:33:22	1.1.2.11
  +++ SAX2DTM.java	2001/05/16 23:29:00	1.1.2.12
  @@ -269,9 +269,18 @@
      */
     public void clearCoRoutine()
     {
  +    clearCoRoutine(true);
  +  }
  +  
  +  /**
  +   * Ask the CoRoutine parser to doTerminate and clear the reference.
  +   */
  +  public void clearCoRoutine(boolean callDoTerminate)
  +  {
       if(null != m_coroutineParser)
       {
  -      m_coroutineParser.doTerminate(m_appCoroutineID);
  +      if(callDoTerminate)
  +        m_coroutineParser.doTerminate(m_appCoroutineID);
         m_coroutineParser = null;
       }
     }
  @@ -1418,8 +1427,7 @@
   
       try
       {
  -      systemId = SystemIDResolver.getAbsoluteURI(systemId,
  -                                                 getDocumentBaseURI(0));
  +      systemId = SystemIDResolver.getAbsoluteURI(systemId, getDocumentBaseURI());
       }
       catch (Exception e)
       {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.2   +1 -1      xml-xalan/java/src/org/apache/xpath/functions/FuncDoclocation.java
  
  Index: FuncDoclocation.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/functions/FuncDoclocation.java,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- FuncDoclocation.java	2001/04/10 18:45:28	1.3.2.1
  +++ FuncDoclocation.java	2001/05/16 23:29:07	1.3.2.2
  @@ -102,7 +102,7 @@
   
         if (DTM.NULL != whereNode)
         {        
  -        fileLocation = dtm.getDocumentBaseURI(whereNode);
  +        fileLocation = dtm.getDocumentBaseURI();
   //        int owner = dtm.getDocument();
   //        fileLocation = xctxt.getSourceTreeManager().findURIFromDoc(owner);
         }
  
  
  

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