[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [docbook] Re: DocBook 5.0: The Definitive Guide
Ah, I get it now.. I was surprised that docbook.xsl was actually handling my book.xml even though I was passing in the namespace.. I was expecting all <xsl:template> to be ignored as they are for the no-namespace elements.. What is happening is that docbook.xsl strips out the namespace (for Relax NG) and rebuilds the entire XML without namespace - as the code suggests that was included by Mauritz.. But for chunk.xsl stylesheet, since docbook.xsl was imported, and the chunk-code.xsl is included, the latter's "/" template took precendence over the docbook.xsl and the stripping of the namespace didn't happen.. Thanks Mauritz for your response. Since my book is gonna be huge, it's probably better to ignore the namespace in the instance xml instead.. and save on memory during processing. It actually has a side benefit with nXML when removing the namespace.. Suddenly, my book can now be validated correctly against docbook.rnc schema which was my other query.. I just need to figure out how to allow for xincludes with nxml so that it doesn't complain about it.. Regards. -- Rajal -----Original Message----- From: Mauritz Jeanson [mailto:mj@johanneberg.com] Sent: Friday, January 07, 2005 12:03 AM To: 'Rajal Shah'; 'Norman Walsh' Cc: docbook@lists.oasis-open.org Subject: RE: [docbook] Re: DocBook 5.0: The Definitive Guide > -----Original Message----- > From: Rajal Shah > > When I run it against the chunk.xsl, I get: > ============================================ > $ xsltproc.exe ../docbook/docbook-xsl-1.67.2/html/chunk.xsl > ../myBook/rajal > No template matches book. > No template matches part in book. > No template matches title in part. > <font color="red"><book> > > <font color="red"><part> > > <font color="red"><title>Manage Information</title></font> > > </part></font> > </book></font> The DocBook NG namespace is not stripped when creating chunked output. Here is a fix for that. The following piece of code is from the template with match="/" in html/docbook.xsl. Add it as the first "when" clause to the corresponding template in html/chunk-code.xsl: <xsl:when test="function-available('exsl:node-set') and namespace-uri(*[1]) = 'http://docbook.org/docbook-ng'"> <!-- Hack! If someone hands us a DocBook NG document, toss the namespace --> <!-- and continue. Someday we may reverse this logic and add the namespace --> <!-- to documents that don't have one. But not before the whole stylesheet --> <!-- has been converted to use namespaces. i.e., don't hold your breath --> <xsl:variable name="nons"> <xsl:apply-templates mode="stripNS"/> </xsl:variable> <xsl:apply-templates select="exsl:node-set($nons)"/> </xsl:when> /MJ
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]