You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by cu...@locus.apache.org on 2000/11/09 23:12:38 UTC

cvs commit: xml-xalan/test/java/src/org/apache/qetest/trax LoggingURIResolver.java

curcuru     00/11/09 14:12:38

  Modified:    test/java/src/org/apache/qetest/trax LoggingURIResolver.java
  Log:
  Implement new javax.xml.transform API 'resolve'
  Left old API's in there for now; should probably be removed later
  
  Revision  Changes    Path
  1.2       +38 -7     xml-xalan/test/java/src/org/apache/qetest/trax/LoggingURIResolver.java
  
  Index: LoggingURIResolver.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/trax/LoggingURIResolver.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LoggingURIResolver.java	2000/11/01 23:26:54	1.1
  +++ LoggingURIResolver.java	2000/11/09 22:12:38	1.2
  @@ -63,8 +63,9 @@
   package org.apache.qetest.trax;
   
   import org.apache.qetest.*;
  -import org.apache.trax.URIResolver;
  -import org.apache.trax.TransformException;
  +import javax.xml.transform.Source;
  +import javax.xml.transform.URIResolver;
  +import javax.xml.transform.TransformerException;
   
   import org.w3c.dom.Node;
   
  @@ -77,7 +78,7 @@
    * Implementation of URIResolver that logs all calls.
    * Currently just provides default service; returns null.
    * @author shane_curcuru@lotus.com
  - * @version $Id: LoggingURIResolver.java,v 1.1 2000/11/01 23:26:54 curcuru Exp $
  + * @version $Id: LoggingURIResolver.java,v 1.2 2000/11/09 22:12:38 curcuru Exp $
    */
   public class LoggingURIResolver implements URIResolver
   {
  @@ -212,9 +213,9 @@
        * @todo have a settable property to actually return as the InputSource
        * @param inputSource The value returned from the EntityResolver.
        * @return (null currently) a DOM node that represents the resolution of the URI
  -     * @exception TransformException never thrown currently
  +     * @exception TransformerException never thrown currently
        */
  -    public Node getDOMNode(InputSource inputSource) throws TransformException
  +    public Node getDOMNode(InputSource inputSource) throws TransformerException
       {
   
           URICtr++;
  @@ -237,10 +238,10 @@
        * @todo have a settable property to actually return as the InputSource
        * @param inputSource The value returned from the EntityResolver.
        * @return (null currently) a SAX2 parser to use with the InputSource.
  -     * @exception TransformException never thrown currently
  +     * @exception TransformerException never thrown currently
        */
       public XMLReader getXMLReader(InputSource inputSource)
  -            throws TransformException
  +            throws TransformerException
       {
   
           URICtr++;
  @@ -254,5 +255,35 @@
           }
   
           return null;
  +    }
  +
  +
  +    /**
  +     * This will be called by the processor when it encounters
  +     * an xsl:include, xsl:import, or document() function.
  +     *
  +     * @param href An href attribute, which may be relative or absolute.
  +     * @param base The base URI in effect when the href attribute was encountered.
  +     *
  +     * @return A non-null Source object.
  +     *
  +     * @throws TransformerException
  +     */
  +    public Source resolve(String href, String base) 
  +            throws TransformerException
  +    {
  +
  +        URICtr++;
  +
  +        setLastURI("{" + base + "}" + href);
  +
  +        if (reporter != null)
  +        {
  +            reporter.logMsg(level,
  +                            prefix + getLastURI() + " " + getCounterString());
  +        }
  +
  +        return null;    // @todo do we need to return anything here?
  +
       }
   }