cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/xml XMLUtils.java
Date Fri, 11 Oct 2002 06:30:41 GMT
cziegeler    2002/10/10 23:30:41

  Modified:    src/scratchpad/src/org/apache/cocoon/sunshine/connector Tag:
                        cocoon_2_0_3_branch ResourceConnectorImpl.java
               src/java/org/apache/cocoon/xml Tag: cocoon_2_0_3_branch
                        XMLUtils.java
  Log:
  Synchronizing branch with HEAD: Adding fix for Xalan bug
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.3   +2 -1      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/connector/Attic/ResourceConnectorImpl.java
  
  Index: ResourceConnectorImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/connector/Attic/ResourceConnectorImpl.java,v
  retrieving revision 1.4.2.2
  retrieving revision 1.4.2.3
  diff -u -r1.4.2.2 -r1.4.2.3
  --- ResourceConnectorImpl.java	7 Jun 2002 09:34:24 -0000	1.4.2.2
  +++ ResourceConnectorImpl.java	11 Oct 2002 06:30:41 -0000	1.4.2.3
  @@ -489,6 +489,7 @@
   
               // Create Document Fragment
               final Document doc = builder.getDocument();
  +            System.out.println( "Document\n" + XMLUtils.serializeNodeToXML(doc));
               frag = doc.createDocumentFragment();
               final Node root = doc.getDocumentElement();
               Node child;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.1   +13 -2     xml-cocoon2/src/java/org/apache/cocoon/xml/XMLUtils.java
  
  Index: XMLUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/xml/XMLUtils.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- XMLUtils.java	2 Apr 2002 14:13:34 -0000	1.6
  +++ XMLUtils.java	11 Oct 2002 06:30:41 -0000	1.6.2.1
  @@ -72,6 +72,7 @@
   import javax.xml.transform.OutputKeys;
   import javax.xml.transform.dom.DOMSource;
   import javax.xml.transform.stream.StreamResult;
  +import javax.xml.transform.stream.StreamSource;
   
   /**
    * XML utility methods.
  @@ -213,6 +214,13 @@
           return format;
       }
   
  +    // FIXME - for Xalan bug
  +    public static String xalanBugStylesheet = "<?xml version=\"1.0\"?><xsl:stylesheet
version=\"1.0\""+
  +                                       " xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">"+
  +                                       "<xsl:template match=\"node()|@*\"><xsl:copy>"+
  +                                       "<xsl:apply-templates select=\"node()|@*\"/>"+
  +                                       "</xsl:copy></xsl:template></xsl:stylesheet>";
  +
       /**
        * Serialize a DOM node to a String.
        * The format of the output can be specified with the properties.
  @@ -224,7 +232,10 @@
               if (node == null) return "";
               StringWriter writer = new StringWriter();
               Transformer transformer;
  -            transformer = TransformerFactory.newInstance().newTransformer();
  +            // transformer = TransformerFactory.newInstance().newTransformer();
  +            // FIXME - This is a workaround for bug #5779 of Xalan
  +            transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new
java.io.StringReader(xalanBugStylesheet)));
  +            // End workaround
               transformer.setOutputProperties(format);
               transformer.transform(new DOMSource(node), new StreamResult(writer));
               return writer.toString();
  
  
  

----------------------------------------------------------------------
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