cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/xml/dom DOMStreamer.java
Date Sat, 22 Nov 2003 05:03:00 GMT
vgritsenko    2003/11/21 21:03:00

  Modified:    src/java/org/apache/cocoon/xml/dom DOMStreamer.java
  Log:
  imports, braces, align...
  
  Revision  Changes    Path
  1.13      +31 -22    cocoon-2.1/src/java/org/apache/cocoon/xml/dom/DOMStreamer.java
  
  Index: DOMStreamer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/xml/dom/DOMStreamer.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DOMStreamer.java	15 Oct 2003 16:10:29 -0000	1.12
  +++ DOMStreamer.java	22 Nov 2003 05:02:59 -0000	1.13
  @@ -50,25 +50,34 @@
   */
   package org.apache.cocoon.xml.dom;
   
  +import java.util.HashMap;
  +import java.util.Iterator;
  +import java.util.Map;
  +
  +import javax.xml.transform.Transformer;
  +import javax.xml.transform.TransformerConfigurationException;
  +import javax.xml.transform.TransformerException;
  +import javax.xml.transform.TransformerFactory;
  +import javax.xml.transform.dom.DOMSource;
  +import javax.xml.transform.sax.SAXResult;
  +
   import org.apache.cocoon.xml.AbstractXMLProducer;
  +import org.apache.cocoon.xml.EmbeddedXMLPipe;
   import org.apache.cocoon.xml.XMLConsumer;
   import org.apache.cocoon.xml.XMLProducer;
  -import org.apache.cocoon.xml.EmbeddedXMLPipe;
  +
  +import org.w3c.dom.Attr;
  +import org.w3c.dom.Comment;
  +import org.w3c.dom.Element;
  +import org.w3c.dom.EntityReference;
  +import org.w3c.dom.NamedNodeMap;
  +import org.w3c.dom.Node;
  +import org.w3c.dom.ProcessingInstruction;
  +import org.w3c.dom.Text;
   import org.xml.sax.ContentHandler;
   import org.xml.sax.SAXException;
  -import org.xml.sax.helpers.AttributesImpl;
   import org.xml.sax.ext.LexicalHandler;
  -import org.w3c.dom.*;
  -
  -import javax.xml.transform.TransformerFactory;
  -import javax.xml.transform.Transformer;
  -import javax.xml.transform.TransformerConfigurationException;
  -import javax.xml.transform.TransformerException;
  -import javax.xml.transform.sax.SAXResult;
  -import javax.xml.transform.dom.DOMSource;
  -import java.util.Iterator;
  -import java.util.Map;
  -import java.util.HashMap;
  +import org.xml.sax.helpers.AttributesImpl;
   
   /**
    * The <code>DOMStreamer</code> is a utility class that will generate SAX
  @@ -158,6 +167,7 @@
           defaultDOMStreamer.setContentHandler(handler);
           namespaceNormalizingDOMStreamer.setContentHandler(handler);
       }
  +
       /**
        * Set the <code>LexicalHandler</code> that will receive XML data.
        */
  @@ -170,10 +180,11 @@
        * Start the production of SAX events.
        */
       public void stream(Node node) throws SAXException {
  -        if (normalizeNamespaces)
  +        if (normalizeNamespaces) {
               namespaceNormalizingDOMStreamer.stream(node);
  -        else
  +        } else {
               defaultDOMStreamer.stream(node);
  +        }
       }
   
       public boolean isNormalizeNamespaces() {
  @@ -248,20 +259,18 @@
               }
   
               Node top = pos;
  -
               while (null != pos) {
                   startNode(pos);
   
                   Node nextNode = pos.getFirstChild();
  -
                   while (null == nextNode) {
                       endNode(pos);
   
  -                    if (top.equals(pos))
  +                    if (top.equals(pos)) {
                           break;
  +                    }
   
                       nextNode = pos.getNextSibling();
  -
                       if (null == nextNode) {
                           pos = pos.getParentNode();
   
  @@ -733,10 +742,10 @@
               ContentHandler handler;
               if (node.getNodeType() == Node.DOCUMENT_NODE) {
                   // Pass all SAX events
  -            handler = contentHandler;
  +                handler = contentHandler;
               } else {
                   // Strip start/endDocument
  -            handler = new EmbeddedXMLPipe(contentHandler);
  +                handler = new EmbeddedXMLPipe(contentHandler);
               }
   
               SAXResult result = new SAXResult(handler);
  
  
  

Mime
View raw message