tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/xml XmlMapper.java
Date Fri, 07 Jul 2000 11:58:51 GMT
rubys       00/07/07 04:58:51

  Modified:    src/share/org/apache/jasper/compiler Tag: tomcat_32
                        JspUtil.java
               src/share/org/apache/tomcat/util/xml Tag: tomcat_32
                        XmlMapper.java
  Log:
  Remove com.sun.xml dependencies - prereq JAXP
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.17.2.1  +4 -62     jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java
  
  Index: JspUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v
  retrieving revision 1.17
  retrieving revision 1.17.2.1
  diff -u -r1.17 -r1.17.2.1
  --- JspUtil.java	2000/06/26 18:51:49	1.17
  +++ JspUtil.java	2000/07/07 11:58:50	1.17.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v
1.17 2000/06/26 18:51:49 costin Exp $
  - * $Revision: 1.17 $
  - * $Date: 2000/06/26 18:51:49 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspUtil.java,v
1.17.2.1 2000/07/07 11:58:50 rubys Exp $
  + * $Revision: 1.17.2.1 $
  + * $Date: 2000/07/07 11:58:50 $
    *
    * ====================================================================
    * 
  @@ -80,8 +80,6 @@
   import org.xml.sax.EntityResolver;
   import org.xml.sax.SAXException;
   import org.xml.sax.InputSource;
  -import com.sun.xml.tree.*;
  -import com.sun.xml.parser.*;
   
   /** 
    * This class has all the utility method(s).
  @@ -134,66 +132,10 @@
       }
   
       // Parses the XML document contained in the InputStream.
  -    public static XmlDocument parseXMLDocOld(InputStream in, String dtdURL, 
  -    					  String dtdId) throws JasperException 
  -    {
  -	XmlDocument tld;
  -	XmlDocumentBuilder builder = new XmlDocumentBuilder();
  -	
  -        com.sun.xml.parser.ValidatingParser 
  -            parser = new com.sun.xml.parser.ValidatingParser();
  -
  -        /***
  -         * These lines make sure that we have an internal catalog entry for 
  -         * the taglib.dtdfile; this is so that jasper can run standalone 
  -         * without running out to the net to pick up the taglib.dtd file.
  -         */
  -        Resolver resolver = new Resolver();
  -	URL dtdURL1 =  resolver.getClass().getResource(dtdURL);
  -			
  -        resolver.registerCatalogEntry(dtdId, 
  -                                      dtdURL1.toString());
  -        
  -        try {
  -            parser.setEntityResolver(resolver);
  -            builder.setParser(parser);
  -            builder.setDisableNamespaces(false);
  -            parser.parse(new InputSource(in));
  -        } catch (SAXException sx) {
  -            throw new JasperException(Constants.getString(
  -	    	"jsp.error.parse.error.in.TLD", new Object[] {
  -							sx.getMessage()
  -		    				     }));
  -        } catch (IOException io) {
  -            throw new JasperException(Constants.getString(
  -	    		"jsp.error.unable.to.open.TLD", new Object[] {
  -							    io.getMessage() }));
  -        }
  -        
  -        tld = builder.getDocument();
  -	return tld;
  -    }
  -
  -    static boolean jaxp=false;
  -    static {
  -	try {
  -	    Class.forName( "javax.xml.parsers.SAXParserFactory" );
  -	    jaxp=true;
  -	} catch(Throwable ex ) {
  -	}
  -    }
  -
  -    // Parses the XML document contained in the InputStream.
  -    // Will try first to use JAXP, if that fails revert to old method.
  -    // This will go away soon - but it's required if you want to use tomcat
  -    // inside j2ee ( class conflict, bug - can't use jaxp right now)
       public static Document parseXMLDoc(InputStream in, String dtdResource, 
       					  String dtdId) throws JasperException 
       {
  -	if( jaxp ) 
  -	    return parseXMLDocJaxp(in, dtdResource, dtdId );
  -	else 
  -	    return parseXMLDocOld( in, dtdResource, dtdId);
  +	return parseXMLDocJaxp(in, dtdResource, dtdId );
       }
   
       // Parses the XML document contained in the InputStream.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.25.2.1  +6 -28     jakarta-tomcat/src/share/org/apache/tomcat/util/xml/XmlMapper.java
  
  Index: XmlMapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/xml/XmlMapper.java,v
  retrieving revision 1.25
  retrieving revision 1.25.2.1
  diff -u -r1.25 -r1.25.2.1
  --- XmlMapper.java	2000/06/26 18:51:50	1.25
  +++ XmlMapper.java	2000/07/07 11:58:51	1.25.2.1
  @@ -195,14 +195,6 @@
   	System.out.println("XmlMapper: " + msg);
       }
   
  -    static boolean jaxp=false;
  -    static {
  -	try {
  -	    Class.forName( "javax.xml.parsers.SAXParserFactory" );
  -	    jaxp=true;
  -	} catch(Throwable ex ) {
  -	}
  -    }
       /** read an XML file, construct and return the object hierarchy
        */
       public Object readXml(File xmlFile, Object root)
  @@ -214,26 +206,12 @@
   	    st.push( root );
   	}
   	try {
  -	    if( jaxp ) {
  -		SAXParser parser=null;
  -		SAXParserFactory factory = SAXParserFactory.newInstance();
  -		factory.setNamespaceAware(false);
  -		factory.setValidating(validating);
  -		parser = factory.newSAXParser();
  -		parser.parse(xmlFile, this);
  -	    } else {
  -		org.xml.sax.Parser saxparser=null;
  -		if(System.getProperty("org.xml.sax.parser") != null )
  -		    saxparser=ParserFactory.makeParser();
  -		else
  -		    saxparser=ParserFactory.
  -			makeParser("com.sun.xml.parser.Parser");
  -
  -		saxparser.setDocumentHandler( this );
  -		saxparser.setEntityResolver( this );
  -		saxparser.setDTDHandler( this );
  -		saxparser.parse(new InputSource( new FileReader( xmlFile)));
  -	    }
  +	    SAXParser parser=null;
  +	    SAXParserFactory factory = SAXParserFactory.newInstance();
  +	    factory.setNamespaceAware(false);
  +	    factory.setValidating(validating);
  +	    parser = factory.newSAXParser();
  +	    parser.parse(xmlFile, this);
   
   	    return root;
   	    // assume the stack is in the right position.
  
  
  

Mime
View raw message