cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pruss...@apache.org
Subject cvs commit: xml-cocoon/webapp cocoon.xconf
Date Thu, 08 Feb 2001 11:59:47 GMT
prussell    01/02/08 03:59:46

  Modified:    src/org/apache/cocoon/components/parser Tag: xml-cocoon2
                        JaxpParser.java
               webapp   Tag: xml-cocoon2 cocoon.xconf
  Log:
  Fixing JaxpParser - which was failing to compile - and making it the
  default parser in the demo web application. I've tested this with all
  the non-sql examples, but I don't have a database set up to test the
  SQL ones, so perhaps someone who does could give that a quick check.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +17 -6     xml-cocoon/src/org/apache/cocoon/components/parser/Attic/JaxpParser.java
  
  Index: JaxpParser.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/parser/Attic/JaxpParser.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- JaxpParser.java	2001/02/07 17:35:19	1.1.2.1
  +++ JaxpParser.java	2001/02/08 11:59:37	1.1.2.2
  @@ -17,6 +17,7 @@
   import org.xml.sax.SAXParseException;
   import org.xml.sax.XMLReader;
   import org.w3c.dom.Document;
  +import org.w3c.dom.DOMImplementation;
   import javax.xml.parsers.SAXParserFactory;
   import javax.xml.parsers.SAXParser;
   import javax.xml.parsers.ParserConfigurationException;
  @@ -28,7 +29,7 @@
    * If only we can get rid of the need for the Document...
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/02/07 17:35:19 $
  + * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/02/08 11:59:37 $
    */
   public class JaxpParser extends AbstractXMLProducer
   implements Parser, ErrorHandler, ThreadSafe {
  @@ -70,7 +71,15 @@
        * Create a new Document object.
        */
       public Document newDocument() {
  -        return this.newDocument(null, null, null);
  +        DocumentBuilder builder = null;
  +        
  +        try {
  +            builder = this.docfactory.newDocumentBuilder();
  +        } catch (ParserConfigurationException pce) {
  +            log.error("Could not create DocumentBuilder", pce);
  +            return null;
  +        }
  +        return builder.newDocument();
       }
   
       /**
  @@ -94,10 +103,12 @@
               return null;
           }
   
  -        return builder.getDOMImplementation()
  -               .createDocument(null, name,
  -                   builder.getDOMImplementation()
  -                   .createDocumentType(name, publicId, systemId)
  +        // Fixme: is there a better way to achieve this?
  +        DOMImplementation impl = builder.newDocument().getImplementation();
  +        return impl.createDocument(
  +            null,
  +            name,
  +            impl.createDocumentType(name, publicId, systemId)
           );
   
       }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.19  +1 -1      xml-cocoon/webapp/Attic/cocoon.xconf
  
  Index: cocoon.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/webapp/Attic/cocoon.xconf,v
  retrieving revision 1.1.2.18
  retrieving revision 1.1.2.19
  diff -u -r1.1.2.18 -r1.1.2.19
  --- cocoon.xconf	2001/02/06 15:23:41	1.1.2.18
  +++ cocoon.xconf	2001/02/08 11:59:44	1.1.2.19
  @@ -3,7 +3,7 @@
   
   <!-- ===================== General Components =========================== -->
   
  -  <parser class="org.apache.cocoon.components.parser.XercesParser"/>
  +  <parser class="org.apache.cocoon.components.parser.JaxpParser"/>
     <store class="org.apache.cocoon.components.store.MemoryStore"/>
   
     <programming-languages>
  
  
  

Mime
View raw message