This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook-apps] jdk 1.5 and docbook xsl


Ok Jirka ... this workaround works fine. Hope that at some times the "with compiled stylesheet transformer" of JDK 1.5 will do the same work than the "with not compiled" and will enalbe a simple xsl:import of the docbook stylesheet. I will test regularly and let the list knows.

For those who wich to take this solution and that are chunking the HTML result file, there is one little thing to do to the XSL stylesheet because the "write extension" is not at the same place in the xalan.jar file (not in the rt.jar).

One, declare the extension in chunker.xsl (here, I use xmlns:xalanjaxpredirect) :

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:saxon="http://icl.com/saxon"; xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect" xmlns:xalanjaxpredirect="com.sun.org.apache.xalan.internal.lib.Redirect" xmlns:exsl="http://exslt.org/common"; xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"; xmlns="http://www.w3.org/1999/xhtml"; version="1.1" exclude-result-prefixes="doc" extension-element-prefixes="saxon xalanredirect exsl xalanjaxpredirect">




Second change the xalan selector in the <xsl:template name="make-relative-filename">


<xsl:when test="element-available('xalanredirect:write') or element-available('xalanjaxpredirect:write') or element-available('xsl:result-document')">
<!-- Xalan doesn't make the chunks relative -->
<xsl:value-of select="concat($base.dir,$base.name)"/>
</xsl:when>





Then, add a new selector in the chunker itself :
<xsl:when test="element-available('xalanjaxpredirect:write')">
<!-- Xalan usewith jdk 1.5 -->
<xalanjaxpredirect:write file="{$filename}">
<xsl:copy-of select="$content"/>
</xalanjaxpredirect:write>
</xsl:when>


Bob, should I submit this as a bug ? A RFE ?

Many thanks to all, pierre

At 23:46 30/01/2005, you wrote:
Pierre Attar wrote:

If you add interpretive Xalan into your classpath (or use standalone JAXP 1.3) and if you will change appropriate property which specifies TransformerFactory you should be able to use JDK 1.5 with DocBook stylesheets right now.

java -Djavax.xml.transform.TransformerFactory=
    com.sun.org.apache.xalan.internal.processor.TransformerFactoryImpl ...

Ok but where doe this class comes from in the JDK 1.5 ? The only place where I found a TransformerFactoryImpl is in the rt.jar and it is under the package com.sun.org.apache.xalan.internal.xsltc.trax. If I'm able to use com.sun.org.apache.xalan.internal.processor.TransformerFactoryImpl, then I'm fully happy becaus it seems that this correspond to the non compiled Xalan processor... problem, exploring all JDK jar, I never found this class.

As I wrote earlier, you must put standalone Xalan or JAXP 1.3 into your classpath. JDK 1.5 comes with stripped down version of JAXP 1.3 where is only XLSTC not interpretive Xalan.


I think that grabbing JAXP 1.3 from

https://jaxp.dev.java.net/servlets/ProjectDocumentList?folderID=2068&expandFolder=2068&folderID=0

and placing xalan.jar from this download into classpath should work with JDK 1.5.

--
------------------------------------------------------------------
  Jirka Kosek     e-mail: jirka@kosek.cz     http://www.kosek.cz
------------------------------------------------------------------
  Profesionální ¹kolení a poradenství v oblasti technologií XML.
     Podívejte se na ná¹ novì spu¹tìný web http://DocBook.cz
       Podrobný pøehled ¹kolení http://xmlguru.cz/skoleni/
------------------------------------------------------------------





Pierre Attar (mailto:pat@tireme.fr)
Consultant en informatique documentaire XML
Consultant in Structured Document engineering

Projet "Mutualiser l'effort de montée en compétences sur XML"
http://www.mutu-xml.org/index.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]