You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sal Mangano <sa...@into-technology.com> on 2004/08/13 04:04:05 UTC

Bizaro Problem

Has anyone experienced a problem with xalan 2.6.0 + cocoon xhtml serializer
that results in opening tags without namespace prefixes and closing tags
with! Here is a snipet of actual output I am getting: 

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	<!-- Snip -->
</head>
  <body>
    <table id="topads" cellspacing="0">
        <tr>
          <td class="ad" rowspan="1" colspan="1">
            <div class="ad" id="adtop1"><xhtm:a href="ads/click?bannerID=11"
class="ad-link" id="ad-link-11" target="_blank"
xmlns:cinclude="http://apache.org/cocoon/include/1.0"
xmlns:xhtm="http://www.w3.org/1999/xhtml"><xhtm:img
src="ads/images/11.gif" alt="OSE" class="ad-img" id="ad-img-11"
/></xhtm:a></xhtm:div>
          </xhtm:td>
        </xhtm:tr>
        
    </xhtm:table>
	<!-- Snip -->
  </xhtm:body>
</xhtm:html>

Here is more info:

I am using Coccoon 2.1.5 with Saxon 7.7 and Xalan 2.6.0 on Windows 2003
Server. I play the game of renaming saxon7.jar to z_saxon7.jar so as to
avoid the problem with the saxon dom being read only. This works but it
leads directly to the above issue. Without the rename I don't get this
nonsense but with it I do. This leads me to belive that in the cases where
cocoon picks up the default xslt transform and gets xalan it is going nuts. 

To make matters worse, this works fine on my dev box which is Windows 2000
(not server). I have a nagging feeling the prod box may be running Tomcat
5.x while my dev box has 4.1.3. I can't confirm that now because I can't
access the prod box where I am at the moment. Anyway, if anyone has seen
something like this under any configuration please let me know. 
 
---------------------------------------------------------
Sal Mangano
Into Technology Inc.
www.into-technology.com

Use XSLT? Try the XSLT Cookbook
http://www.oreilly.com/catalog/xsltckbk/  


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


Configuring the transformer-factory to better uses Saxon or Xalan where each is better suited [Was Bizaro Problem]

Posted by Sal Mangano <sm...@ureach.com>.
Here is an update on how I resolved the problem of this original post.

It turns out to not be related to Tomcat 4 vs. 5. I can make it happen on
either. It is a bug in Xalan for sure but I have not had time to find a nice
clean test case to make it happen. However, the work around is:

1) Make sure Saxon is used by the XHTML or any other serializer where the
"readonly Saxon DOM" does not matter by doings something like:

    <map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html"
name="xhtml" pool-grow="2" pool-max="64" pool-min="2"
src="org.apache.cocoon.serialization.XMLSerializer">
      <doctype-public>-//W3C//DTD XHTML 1.0
Transitional//EN</doctype-public>
 
<doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</doc
type-system>
      <encoding>ISO-8859-1</encoding>
      <!--SRM 2004-08-18: This fixes bizarre namespace prefix serialization
problem -->
      <!--The complemetary fix is to hack saxon7.jar to remove
META-INF/services -->
 
<transformer-factory>net.sf.saxon.TransformerFactoryImpl</transformer-factor
y>
    </map:serializer>

2) Make sure Saxon transformer is not picked up by Cocoon by default by
removing META-INF/services
from the Saxon jar. I found that this was necessary, for example, to use the
source writer transformer where the Saxon DOM
will not do. 

It would be nicer and avoid hacking the Saxon jar, if every component which
uses javax.xml.transform.TransformerFactory allowed
a configuration parameter like <transformer-factory> in the serializer. It
seems that org.apache.cocoon.xml.dom.DOMBuiler would need to be made
configurable for things like the SourceWritingTransformer to in turn be
configurable, in this regard.


> -----Original Message-----
> From: Sal Mangano [mailto:sal.mangano@into-technology.com] 
> Sent: Thursday, August 12, 2004 10:04 PM
> To: users@cocoon.apache.org
> Subject: Bizaro Problem 
> 
> 
> 
> Has anyone experienced a problem with xalan 2.6.0 + cocoon 
> xhtml serializer that results in opening tags without 
> namespace prefixes and closing tags with! Here is a snipet of 
> actual output I am getting: 
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
> Transitional//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
>   <head>
> 	<!-- Snip -->
> </head>
>   <body>
>     <table id="topads" cellspacing="0">
>         <tr>
>           <td class="ad" rowspan="1" colspan="1">
>             <div class="ad" id="adtop1"><xhtm:a 
> href="ads/click?bannerID=11" class="ad-link" id="ad-link-11" 
> target="_blank" xmlns:cinclude="http://apache.org/cocoon/include/1.0"
> xmlns:xhtm="http://www.w3.org/1999/xhtml"><xhtm:img
> src="ads/images/11.gif" alt="OSE" class="ad-img" 
> id="ad-img-11" /></xhtm:a></xhtm:div>
>           </xhtm:td>
>         </xhtm:tr>
>         
>     </xhtm:table>
> 	<!-- Snip -->
>   </xhtm:body>
> </xhtm:html>
> 
> Here is more info:
> 
> I am using Coccoon 2.1.5 with Saxon 7.7 and Xalan 2.6.0 on 
> Windows 2003 Server. I play the game of renaming saxon7.jar 
> to z_saxon7.jar so as to avoid the problem with the saxon dom 
> being read only. This works but it leads directly to the 
> above issue. Without the rename I don't get this nonsense but 
> with it I do. This leads me to belive that in the cases where 
> cocoon picks up the default xslt transform and gets xalan it 
> is going nuts. 
> 
> To make matters worse, this works fine on my dev box which is 
> Windows 2000 (not server). I have a nagging feeling the prod 
> box may be running Tomcat 5.x while my dev box has 4.1.3. I 
> can't confirm that now because I can't access the prod box 
> where I am at the moment. Anyway, if anyone has seen 
> something like this under any configuration please let me know. 
>  
> ---------------------------------------------------------
> Sal Mangano
> Into Technology Inc.
> www.into-technology.com
> 
> Use XSLT? Try the XSLT Cookbook 
> http://www.oreilly.com/catalog/xsltckbk/  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 


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