cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ba...@apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/transformation XIncludeTransformer.java
Date Mon, 23 Apr 2001 02:06:18 GMT
balld       01/04/22 19:06:18

  Modified:    src/org/apache/cocoon/components/parser Tag: xml-cocoon2
                        JaxpParser.java Parser.java
               src/org/apache/cocoon/transformation Tag: xml-cocoon2
                        XIncludeTransformer.java
  Log:
  little patch bundle to avoid the DOMBuilder stuff for XIncludeTransformer
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +15 -1     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.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- JaxpParser.java	2001/04/20 20:49:59	1.1.2.5
  +++ JaxpParser.java	2001/04/23 02:06:16	1.1.2.6
  @@ -28,7 +28,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.5 $ $Date: 2001/04/20 20:49:59 $
  + * @version CVS $Revision: 1.1.2.6 $ $Date: 2001/04/23 02:06:16 $
    */
   public class JaxpParser extends AbstractXMLProducer
   implements Parser, ErrorHandler {
  @@ -110,6 +110,20 @@
               impl.createDocumentType(name, publicId, systemId)
           );
   
  +    }
  +
  +    /**
  +     * Parses a new Document object from the given InputSource.
  +     */
  +    public Document parseDocument(InputSource input) throws SAXException, IOException {
  +      DocumentBuilder builder = null;
  +      try {
  +        builder = this.docfactory.newDocumentBuilder();
  +      } catch (ParserConfigurationException pce) {
  +        getLogger().error("Could not build DocumentBuilder", pce);
  +        return null;
  +      }
  +      return builder.parse(input);
       }
   
       /**
  
  
  
  1.1.2.13  +4 -1      xml-cocoon/src/org/apache/cocoon/components/parser/Attic/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/parser/Attic/Parser.java,v
  retrieving revision 1.1.2.12
  retrieving revision 1.1.2.13
  diff -u -r1.1.2.12 -r1.1.2.13
  --- Parser.java	2001/04/20 20:49:59	1.1.2.12
  +++ Parser.java	2001/04/23 02:06:16	1.1.2.13
  @@ -13,14 +13,17 @@
   import org.apache.cocoon.xml.dom.DOMFactory;
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
  +import org.w3c.dom.Document;
   
   /**
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.2.12 $ $Date: 2001/04/20 20:49:59 $
  + * @version CVS $Revision: 1.1.2.13 $ $Date: 2001/04/23 02:06:16 $
    */
   public interface Parser extends Component, XMLProducer, DOMFactory {
   
       void parse(InputSource in) throws SAXException, IOException;
  +
  +    Document parseDocument(InputSource in) throws SAXException, IOException;
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.28  +2 -7      xml-cocoon/src/org/apache/cocoon/transformation/Attic/XIncludeTransformer.java
  
  Index: XIncludeTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/transformation/Attic/XIncludeTransformer.java,v
  retrieving revision 1.1.2.27
  retrieving revision 1.1.2.28
  diff -u -r1.1.2.27 -r1.1.2.28
  --- XIncludeTransformer.java	2001/04/20 20:50:17	1.1.2.27
  +++ XIncludeTransformer.java	2001/04/23 02:06:18	1.1.2.28
  @@ -53,7 +53,7 @@
    * by the SAX event FSM yet.
    *
    * @author <a href="mailto:balld@webslingerZ.com">Donald Ball</a>
  - * @version CVS $Revision: 1.1.2.27 $ $Date: 2001/04/20 20:50:17 $ $Author: bloritsch $
  + * @version CVS $Revision: 1.1.2.28 $ $Date: 2001/04/23 02:06:18 $ $Author: balld $
    */
   public class XIncludeTransformer extends AbstractTransformer implements Composable, Poolable,
Disposable {
   
  @@ -245,12 +245,7 @@
                   if (suffix.startsWith("xpointer(") && suffix.endsWith(")")) {
                       String xpath = suffix.substring(9,suffix.length()-1);
                       getLogger().debug("XPath is "+xpath);
  -                    DOMBuilder builder = new DOMBuilder(parser);
  -                    parser.setContentHandler(builder);
  -                    parser.setLexicalHandler(builder);
  -                    parser.parse(input);
  -
  -                    Document document = builder.getDocument();
  +                    Document document = parser.parseDocument(input);
                       try {
                           NodeList list = XPathAPI.selectNodeList(document,xpath);
                           DOMStreamer streamer = new DOMStreamer(super.contentHandler,super.lexicalHandler);
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message