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


From saxon command line (SAXON 6.5.3 from Michael Kay), it works perfectly.


The log is the following :


C:\temp>saxon T:\mutu-xml\bin\schemadoc5\sample\out\schemaDocIntermediateDocboo.xml T:\mutu-xml\bin\schemadoc\pgm\db2html\db2html.xslt
Writing sampleSect.html for sect1(sampleSect)
Writing missing.html for sect1(missing)
Writing index_.html for sect1(index_)
Writing definitionTable.html for sect1(definitionTable)
Writing actionTable.html for sect1(actionTable)
Writing decisionTable.html for sect1(decisionTable)
Writing simple.html for appendix(simple)
Writing index.html for article
<?xml version="1.0" encoding="UTF-8"?>
C:\temp>


So, it seems that it's a JDK problem. I also don't understand translet problem and why my stylesheet is compiled.

Is it a new Xalan feature to always internally compile the stylesheet ? I really do not know.

Even if true, why is it only the import clause that makes a problem to the compiler ? ... you'll probabely note that if I use the docbook distribution directly, everything works.

Nevertheless, the fact is that in my real application, I need to import in order to overwrite some stanfard templates.


Regards and thanks for taking time, Pierre


At 03:05 28/01/2005, Bob Stayton wrote:

So the name of your importing stylesheet is "db2html", right?  Can you run
that stylesheet with Saxon or Xalan from the command line, outside of your
program?

I don't understand why the "translet" message is coming up.  I thought
translets were used with compiled stylesheets, not using a stylesheet
directly.  Perhaps someone with more Java XSL experience knows why that
message would be there.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- From: "Pierre Attar" <pat@tireme.fr> To: "Bob Stayton" <bobs@sagehill.net>; <docbook-apps@lists.oasis-open.org> Sent: Thursday, January 27, 2005 3:02 PM Subject: Re: [docbook-apps] jdk 1.5 and docbook xsl


> At 22:23 27/01/2005, Bob Stayton wrote: > >Hi Pierre, > >I still don't understand enough of your problem. > > > >First, let's figure out if this is a docbook problem. Can you run any XSLT > >transformation using your setup? If you use a very simple XML document and > >trivial XSL stylesheet? If that doesn't work, then your class setup is > >having the problem. > > Yes, I'm able to run a transformation. Yes, I'm also able to run the > doxbookx.xsl of the xhtml distribution. > > The only thing, for simplification, db2html is doing is an import of the > docbook distribution like : > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; > xmlns="http://www.w3.org/1999/xhtml"; version="1.0" > xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"; > exclude-result-prefixes="doc"> > <xsl:import href="../docbook-xsl/xhtml/docbook.xsl"/> > </xsl:stylesheet> > > At this time only I've got problems. > > > >If the simple one works, and the DocBook stylesheet doesn't, then we need to > >find out where "db2html" is coming from. As far as I can tell, that isn't > >part of Java 1.5, and it isn't part of the DocBook XSL distribution. Is > >there some DocBook toolkit in your CLASSPATH? I didn't see where you > >described your CLASSPATH. > > db2html is the previous stylesheet. > > My classpath is based on the JDK, as defined by Eclipse default, including : > > rt.jar, jsse.jar, jce.jar, charset.jar, dnsns.jar, localedata.jar, > sunjce_provider.jar, sunpkcs11.jar ... and of course my class. > > > Hope this helps, pierre > > >----- Original Message ----- > >From: "Pierre Attar" <pat@tireme.fr> > >To: <docbook-apps@lists.oasis-open.org> > >Sent: Thursday, January 27, 2005 12:01 PM > >Subject: RE: [docbook-apps] jdk 1.5 and docbook xsl > > > > > >Hi all, > > > >I just repost my answer because I really do not understand what's happening. > > > >Before, I was using saxon plus xerces but in my idea, JDK 1.5 should enable > >me not to deal with two product lines (saxon and xerces) wich is quite > >usefull for me. > > > >That's the reason why I would really be pleased to find a solution to this > >import problem. > > > >Regards, ierre > > > >At 09:49 24/01/2005, you wrote: > > > > >Here are the answers to environment questions. > > > > > >Pierre > > > > > >>Sorry, but it is very difficult to help without more information. In your > > >>original post, you refer to problems with a translet called "db2html", but > > >>you need to provide more details about that. > > >> > > >>Exactly how you start the transformation (command line, your own Java > >class, > > >>...)? > > > > > > > > >I start from My own class and I'me now able to have a best message error : > > > > > >javax.xml.transform.TransformerConfigurationException: Chargement > > >impossible de la classe translet 'db2html'. > > >at > > >com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.defineTransletCl > >asses(TemplatesImpl.java:315) > > >at > > >com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.getTransletInsta > >nce(TemplatesImpl.java:333) > > >at > > >com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl.newTransformer(T > >emplatesImpl.java:366) > > >at > > >com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTran > >sformer(TransformerFactoryImpl.java:620) > > >at > > >fr.tireme.utilities.xml.xslt.ProcessFromCommandLine.main(ProcessFromCommand > >Line.java:111) > > > > > >Line 111 corresponds to the following code line : > > >Transformer transformer = tfactory.newTransformer(new > > >StreamSource(xslFileName)); > > > > > >The stylesheet I use is the folowing one where, for test purpose, I've > > >simplfied up to the simplest import. > > >NOTE that if I use the docbook.xsl it works, it is only while importing > > >that it does not works ! > > > > > > > > ><?xml version="1.0" encoding="UTF-8"?> > > ><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; > > >xmlns="http://www.w3.org/1999/xhtml"; version="1.0" > > >xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"; > > >exclude-result-prefixes="doc"> > > > <xsl:import href="../docbook-xsl/xhtml/docbook.xsl"/> > > ></xsl:stylesheet> > > > > > > > > > > > >>What is on your classpath? What does your source XML look like? Did > > >>you try a different (perhaps non-Java) processor to see if the stylesheets > > >>work with it? > > > > > >Standard within an eclipse environment : only the JDK which meands rt.jar, > > >etc. > > > > > > > > >Note, the Java class looks like : > > > > > > try { > > > PrintWriter resultWriter; > > > StreamResult strResult; > > > > > > if (null != outFileName) { > > > strResult = new StreamResult(new > > > FileOutputStream(outFileName)); > > > strResult.setSystemId(outFileName); > > > } else { > > > strResult = new StreamResult(System.out); > > > } > > > > > > TransformerFactory tfactory = > >TransformerFactory.newInstance(); > > > Transformer transformer = tfactory.newTransformer(new > > > StreamSource( > > > xslFileName)); > > > > > > int nParams = params.size(); > > > > > > for (int ii = 0; ii < nParams; ii += 2) { > > > transformer.setParameter((String) params.elementAt(ii), > > > (String) params.elementAt(ii + 1)); > > > } > > > > > > transformer.transform(new StreamSource(inFileName), > >strResult); > > > > > > } > > >


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]