OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Usin Saxon and XInclude


On Fri, Oct 31, 2003 at 08:27:03PM +0100, Jens Stavnstrup wrote:
> Bob,
> 
> I have been experimenting a bit with the XInclude class in Xerces and
> used your recipe in Chapter 19 regarding Saxon and Xerces 2.5.0.
> 
> For that purpose, I used a book document, extracted the last appendix
> to a separate file. Since my stylesheet only contains the following
> template:
> 
> <xsl:template match="@*|node()">
>   <xsl:copy>
>     <xsl:apply-templates select="@*"/> 
>     <xsl:apply-templates/>
>   </xsl:copy>
> </xsl:template>
> 
> 
> I would expect the resulting document to contain the original
> document, which it does. However, my document fragment also contains a
> doctype declaration. Apparently, this is not a good idea, because for
> some strange reason, the resulting document does also include the
> complete docbook DTD.

Wow, that is really wild.  At first I thought you meant
you were getting the <!DOCTYPE> declaration in your result
document, but in fact you are getting all of the comments
from the entire DocBook DTD, including all the entity and
module files.  But only the comments.

If you change:

   match="@*|node()" 

to

   match="@*|*|processing-instruction()"

then it works as expected, except you lose any comments
in the transformation.  Apparently the Xerces Xinclude
code thinks the comment() pattern includes the comments
in the DTD, which it most certainly should not.  You should
file that as a bug.


> I checked Xerces buglist, but could not see that anybody had
> identified this problem. Have you noticed this before ?
> 
> Besides defining that Xerces should use the XInclude processor, you
> also define that Saxons should use Xerces as its default
> processor.
> 
> What about if you want Saxon to uses Xerces by default, the
> XML Catalog Resolver and the XInclude class as well ?

Yes, you can do that.  You need to make sure your
CLASSPATH includes all the jar files for both options,
and the command line has all the right options.
I think this covers it:

CLASSPATH="../docbook-xsl-1.62.4/extensions/saxon651.jar:/xml/saxon653/saxon.jar:/xml/saxon653/saxon-fop.jar:./resolver.jar:.:/xml/xerces-2_5_0/xercesImpl.jar" \
java \
-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl \
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \
-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration \
com.icl.saxon.StyleSheet \
-x org.apache.xml.resolver.tools.ResolvingXMLReader \
-y org.apache.xml.resolver.tools.ResolvingXMLReader \
-r org.apache.xml.resolver.tools.CatalogResolver \
-o myfile.html \
myfile.xml \
html/docbook.xsl

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]