You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2002/10/11 08:30:41 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/xml XMLUtils.java

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


RE: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/xml XMLUtils.java

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Vadim Gritsenko wrote:
> 
> Hm... Does this bug present in saxon?
> 
Don't know - I would guess not... :)

Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/xml XMLUtils.java

Posted by Vadim Gritsenko <va...@verizon.net>.
Carsten Ziegeler wrote:

>Vadim Gritsenko wrote:
>  
>
>>cziegeler@apache.org wrote:
>>
>>    
>>
>>>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
>>>
>>>      
>>>
>>Carsten,
>>
>>AFAIU, this fix introduces new bug: 
>>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11935
>>Do we need such fix then? It will break many websites...
>>
>>    
>>
>Please, look closely at what I did - I didn't touch the serializers,
>so the answer is: "No, it does not introduce the bug above."
>

Thanks!
And sorry for troubling you :)


>>PS According to 
>>http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=103243914827881&w=2 
>>this xalan bug have no impact on Cocoon. Is it right?
>>    
>>
>Yes, Cocoon is infected by this bug and that in several ways! There
>were some problems in the serializers as well but the main problems
>lie in serializing XML to text. This is for example done in the
>SourceWritingTransformer. In those cases Xalan does not correctly
>handle namespaces (as described in the Xalan bug) and you get
>invalid XML - so this fix is very important.
>

Hm... Does this bug present in saxon?

Vadim



>Thanks
>Carsten
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/xml XMLUtils.java

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Vadim Gritsenko wrote:
> 
> cziegeler@apache.org wrote:
> 
> >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
> >
> 
> Carsten,
> 
> AFAIU, this fix introduces new bug: 
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11935
> Do we need such fix then? It will break many websites...
> 
Please, look closely at what I did - I didn't touch the serializers,
so the answer is: "No, it does not introduce the bug above."

> PS According to 
> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=103243914827881&w=2 
> this xalan bug have no impact on Cocoon. Is it right?
> 
Yes, Cocoon is infected by this bug and that in several ways! There
were some problems in the serializers as well but the main problems
lie in serializing XML to text. This is for example done in the
SourceWritingTransformer. In those cases Xalan does not correctly
handle namespaces (as described in the Xalan bug) and you get
invalid XML - so this fix is very important.

Thanks
Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/xml XMLUtils.java

Posted by Vadim Gritsenko <va...@verizon.net>.
cziegeler@apache.org wrote:

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

Carsten,

AFAIU, this fix introduces new bug: 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11935
Do we need such fix then? It will break many websites...

PS According to 
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=103243914827881&w=2 
this xalan bug have no impact on Cocoon. Is it right?

Vadim



> 
>  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();
>




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org