Re: FW: [xep-support] Modular DocBook 5 documents using XInclude

From: Stephen Taylor <sjt@5jt.com>
Date: Fri Aug 22 2008 - 05:16:48 PDT

Conclusion: I ran into problems invoking Xalan directly without it choking
on the XIncludes, but getting FOP to do it was trivial. For those who
follow: problem solved with something like

%FOP% -xml mydoc.xml -foout mydoc.fo %DOCBKXSL%
xep.bat -fo mydoc.fo -pdf mydoc.pdf

Thanks for support...

Stephen

2008/8/21 Michael Bradbury <bradbury@renderx.com>

> Hello Stephen,
>
> I'm not technical but I offer the following which was posted a few days
> ago:
>
>
> > I have been trying to do a build file for ant using the xep tasks. See
> > a small project zipped up on
> > http://www.filejumbo.com/Download/2450CA55FE1455F1
> >
> > I started out by changing the xep command line tool so it could handle
> > xinclude. It needs to use a newer version of xerces with the xinclude
> > parser configuration enabled, but because of the xml parser bundled
> > with the JDK (old xerces), it needs to be in the endorsed directory.
> > See this option below. I tried to get the old xerces inside the jdk to
> > play along but that doesn't work with xinclude.
> >
> started out by changing the xep command line tool so it could handle
> xinclude. It needs to use a newer version of xerces with the xinclude
> parser
> configuration enabled, but because of the xml parser bundled with the JDK
> (old xerces), it needs to be in the endorsed directory. See this option
> below. I tried to get the old xerces inside the jdk to play along but that
> doesn't work with xinclude.
> ---- working ---
> #!/bin/sh
>
> # XEP command-line
>
> JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home"
> XEP_HOME="/Tools/XEP"
>
>
> CP="/Users/tchristensen/.m2/repository/xerces/xercesImpl/2.8.1/xercesImpl-2.
> 8.1.jar:$JAVA_HOME/lib/tools.jar:\
> $XEP_HOME/lib/xep.jar:\
> $XEP_HOME/lib/saxon.jar:\
> $XEP_HOME/lib/xt.jar"
>
> "$JAVA_HOME/bin/java" \
> -classpath "$CP" \
>
>
> "-Djava.endorsed.dirs=/Users/tchristensen/.m2/repository/xerces/xercesImpl/2
> .8.1" \
> "-Dcom.renderx.xep.CONFIG=$XEP_HOME/xep.xml" \
>
>
> "-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.par
> sers.XIncludeParserConfiguration" \
> com.renderx.xep.XSLDriver "$@"
> ----- working ----
>
> The ant build file however doesn't work. It is set up to much the same way
> but it insists on using the xalan embedded in the jdk and fails with:
>
> ant docs:
>
> [xep] [error] file:/target/lib/docbook-xsl-1.74.0/fo/table.xsl: line
> 415: Attribute 'border-left-style' outside of element.
> [xep] [error] file:/target/lib/docbook-xsl-1.74.0/fo/table.xsl: line
> 416: Attribute 'border-right-style' outside of element.
> [xep] [error] file:/target/lib/docbook-xsl-1.74.0/fo/table.xsl: line
> 417: Attribute 'border-top-style' outside of element.
> [xep] [error] file:/target/lib/docbook-xsl-1.74.0/fo/table.xsl: line
> 418: Attribute 'border-bottom-style' outside of element.
> [xep] [error] file:/target/lib/docbook-xsl-1.74.0/fo/index.xsl: line
> 350: Attribute 'rx:key' outside of element.
> [xep] [error] The first argument to the non-static Java function
> 'insertCallouts' is not a valid object reference.
> [xep] [error] The first argument to the non-static Java function
> 'insertCallouts' is not a valid object reference.
> [xep] [error] The first argument to the non-static Java function
> 'highlight' is not a valid object reference.
> [xep] [error] Error checking type of the expression
> 'com.sun.org.apache.xalan.internal.xsltc.compiler.ApplyTemplates@ba5854'.
> [xep] [error] Could not compile stylesheet
> [xep] [error] javax.xml.transform.TransformerConfigurationException:
> Could not compile stylesheet
>
> If I run it with the following:
> ant -lib ~/Tools/XEP/lib/saxon.jar:target/lib/xercesImpl-2.8.1.jar docs
>
> It does produce a pdf but we are back to the issue of xinclude:
> docs:
> [xep] (document
> [xep] [system-id
> file:/Users/tchristensen/Projects/tryouts/xeptest/src/index.xml]
> [xep] Making portrait pages on USletter paper (8.5inx11in)
> [xep] Element include in namespace 'http://www.w3.org/2001/XInclude'
> encountered in article, but no template matches.
> [xep] Element include in namespace 'http://www.w3.org/2001/XInclude'
> encountered in article, but no template matches.
>
> I'm running a Mac OS X 10.5 with Java 1.5.0_13.
>
>
> >
> > The ant build file however doesn't work. It is set up to much the same
> > way but it insists on using the xalan embedded in the jdk and fails
> > with:
> >
> > ...
>
> And the anwer provided was:
>
>
> The problem is that JVM has been already set its properties when started
> Ant.
> If you need to execute another Java application that overwrites some
> Java properties then the recommended way to do this is to use the <java>
> task with the 'fork' attribute set to 'yes'.
>
> Please note that you should add Ant lib directory into the classpath for
> the "com.renderx.xepx.ant.XEPTask" task.
>
> Another way is to launch Ant script with predefined Java arguments for
> XInclude support (but this is a hack, not a clean approach).
>
>
> Hoping the above helps. If not I suggest you post again to
> xep-support@renderx.com with more details of what you have changed in the
> xep.bat or xep.shell command.
>
> Best Regards,
>
> Michael Bradbury
> bradbury@renderx.com
>
>
>
>
>
>
> -----Original Message-----
> From: owner-xep-support@renderx.com [mailto:owner-xep-support@renderx.com]
> On Behalf Of Stephen Taylor
> Sent: Thursday, August 21, 2008 10:27 AM
> To: xep-support@renderx.com
> Subject: [xep-support] Modular DocBook 5 documents using XInclude
>
> Can I use XEP to format modular DocBook V5 documents?
>
> These use XInclude rather than entity declarations. Apache FOP 0.95
> processes them, but XEP 4.13 objects:
>
>
> Element include in namespace . encountered in book, but no template
> matches.
>
>
> The only traffic I've found on this list recommends modifying my call to
> XEP
> to
>
>
> * add xercesImpl.jar (from my FOP installation, I suppose) to the
> classpath
> * use option
>
> -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.pars
> ers.XIncludeParserConfiguration
>
> This doesn't change the error report. What am I missing?
>
> Presumably I should be able to use Xalan for the XSLT and pipe the FO
> output
> to XEP? Is this a different line of attack?
>
> (I'm running Java 1.6.0.7. I'm considering switching from FOP to XEP in
> order to use figure floats and sidebars in my page designs.)
>
> Thanks in advance
> Stephen Taylor
>
>
>

-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo@renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html
Received on Fri Aug 22 06:00:37 2008

This archive was generated by hypermail 2.1.8 : Fri Aug 22 2008 - 06:00:42 PDT