From: <abd...@us...> - 2008-10-08 16:26:00
|
Revision: 8135 http://docbook.svn.sourceforge.net/docbook/?rev=8135&view=rev Author: abdelazer Date: 2008-10-08 16:25:45 +0000 (Wed, 08 Oct 2008) Log Message: ----------- Ignore anything else in *info for opf.metadata Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2008-10-08 03:43:41 UTC (rev 8134) +++ trunk/xsl/epub/docbook.xsl 2008-10-08 16:25:45 UTC (rev 8135) @@ -535,6 +535,10 @@ </xsl:template> + <xsl:template match="*" mode="opf.metadata"> + <!-- override if you care --> + </xsl:template> + <xsl:template match="author|corpauthor" mode="opf.metadata"> <xsl:variable name="n"> <xsl:call-template name="person.name"> @@ -546,7 +550,7 @@ </xsl:element> </xsl:template> - <xsl:template match="publishername" mode="opf.metadata"> + <xsl:template match="publisher/publishername|publishername" mode="opf.metadata"> <xsl:element name="dc:publisher"> <xsl:value-of select="normalize-space(string(.))"/> </xsl:element> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abd...@us...> - 2009-02-17 04:47:46
|
Revision: 8247 http://docbook.svn.sourceforge.net/docbook/?rev=8247&view=rev Author: abdelazer Date: 2009-02-17 04:47:44 +0000 (Tue, 17 Feb 2009) Log Message: ----------- Patch from Paul Norton of Adobe to get covers to look better in Adobe Digital Editions Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2009-02-17 04:41:34 UTC (rev 8246) +++ trunk/xsl/epub/docbook.xsl 2009-02-17 04:47:44 UTC (rev 8247) @@ -1445,8 +1445,9 @@ <xsl:element name="title">Cover</xsl:element> <xsl:element name="style"> <xsl:attribute name="type">text/css</xsl:attribute> - <xsl:text>.</xsl:text><xsl:value-of select="$epub.cover.image.id"/> - <xsl:text> { width:100%; height: 100%; }</xsl:text> + <!-- Select the cover image by @id in the CSS then apply a max-width to help Adobe Digital Editions --> + <xsl:text>#</xsl:text><xsl:value-of select="$epub.cover.image.id"/> + <xsl:text> img { max-width: 100%; }</xsl:text> </xsl:element> </xsl:element> <xsl:element name="body"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abd...@us...> - 2009-02-17 04:54:54
|
Revision: 8248 http://docbook.svn.sourceforge.net/docbook/?rev=8248&view=rev Author: abdelazer Date: 2009-02-17 04:54:38 +0000 (Tue, 17 Feb 2009) Log Message: ----------- ...continue that last commit, being slightly more generic in the CSS to get the desired output in ADE. Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2009-02-17 04:47:44 UTC (rev 8247) +++ trunk/xsl/epub/docbook.xsl 2009-02-17 04:54:38 UTC (rev 8248) @@ -1445,8 +1445,7 @@ <xsl:element name="title">Cover</xsl:element> <xsl:element name="style"> <xsl:attribute name="type">text/css</xsl:attribute> - <!-- Select the cover image by @id in the CSS then apply a max-width to help Adobe Digital Editions --> - <xsl:text>#</xsl:text><xsl:value-of select="$epub.cover.image.id"/> + <!-- Help the cover image scale nicely in the CSS then apply a max-width to look better in Adobe Digital Editions --> <xsl:text> img { max-width: 100%; }</xsl:text> </xsl:element> </xsl:element> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2009-04-08 18:41:33
|
Revision: 8401 http://docbook.svn.sourceforge.net/docbook/?rev=8401&view=rev Author: bobstayton Date: 2009-04-08 18:41:32 +0000 (Wed, 08 Apr 2009) Log Message: ----------- Check in patch submitted by user to add opf:file-as attribute to dc:creator element. Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2009-04-08 07:44:54 UTC (rev 8400) +++ trunk/xsl/epub/docbook.xsl 2009-04-08 18:41:32 UTC (rev 8401) @@ -614,6 +614,11 @@ </xsl:call-template> </xsl:variable> <xsl:element name="dc:creator"> + <xsl:attribute name="opf:file-as"> + <xsl:call-template name="person.name.last-first"> + <xsl:with-param name="node" select="."/> + </xsl:call-template> + </xsl:attribute> <xsl:value-of select="normalize-space(string($n))"/> </xsl:element> </xsl:template> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abd...@us...> - 2009-04-10 03:49:52
|
Revision: 8405 http://docbook.svn.sourceforge.net/docbook/?rev=8405&view=rev Author: abdelazer Date: 2009-04-10 03:49:50 +0000 (Fri, 10 Apr 2009) Log Message: ----------- Be a little bit more nuanced about dates Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2009-04-10 02:37:59 UTC (rev 8404) +++ trunk/xsl/epub/docbook.xsl 2009-04-10 03:49:50 UTC (rev 8405) @@ -679,9 +679,11 @@ <xsl:with-param name="single.year.ranges" select="$make.single.year.ranges"/> </xsl:call-template> </xsl:variable> - <xsl:element name="dc:date"> - <xsl:value-of select="$copyright.date"/> - </xsl:element> + <xsl:if test="not(../date)"> + <xsl:element name="dc:date"> + <xsl:value-of select="$copyright.date"/> + </xsl:element> + </xsl:if> <xsl:element name="dc:rights"> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'Copyright'"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abd...@us...> - 2009-04-12 23:38:12
|
Revision: 8408 http://docbook.svn.sourceforge.net/docbook/?rev=8408&view=rev Author: abdelazer Date: 2009-04-12 23:37:50 +0000 (Sun, 12 Apr 2009) Log Message: ----------- Add a colon after an abstract/title when mapping into the dc:description for OPF metadata in ePub output to help the flat text have more pseudo-semantics (sugestions from Michael Wiedmann) Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2009-04-12 23:31:56 UTC (rev 8407) +++ trunk/xsl/epub/docbook.xsl 2009-04-12 23:37:50 UTC (rev 8408) @@ -639,13 +639,16 @@ <xsl:choose> <xsl:when test="self::formalpara"> <xsl:value-of select="normalize-space(string(title))"/> - <xsl:text> </xsl:text> + <xsl:text>: </xsl:text> <xsl:value-of select="normalize-space(string(para))"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="normalize-space(string(.))"/> </xsl:otherwise> </xsl:choose> + <xsl:if test="self::title"> + <xsl:text>:</xsl:text> + </xsl:if> <xsl:if test="not(position() = last())"> <xsl:text> </xsl:text> </xsl:if> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abd...@us...> - 2009-08-21 18:51:53
|
Revision: 8519 http://docbook.svn.sourceforge.net/docbook/?rev=8519&view=rev Author: abdelazer Date: 2009-08-21 18:51:40 +0000 (Fri, 21 Aug 2009) Log Message: ----------- Improve the selection of cover images when working in DocBook 4.x land (work in progress) Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2009-08-20 20:10:08 UTC (rev 8518) +++ trunk/xsl/epub/docbook.xsl 2009-08-21 18:51:40 UTC (rev 8519) @@ -982,6 +982,21 @@ </xsl:choose> </xsl:template> + <xsl:template match="cover/mediaobject| + mediaobject[@role='cover']" + mode="opf.manifest"> + <xsl:choose> + <xsl:when test="imageobject[@role='front-large']"> + <xsl:apply-templates select="imageobject[@role='front-large']/imagedata" + mode="opf.manifest"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="imageobject/imagedata[1]" + mode="opf.manifest"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + <xsl:template match="mediaobjectco" mode="opf.manifest"> <xsl:message>WARNING: mediaobjectco almost certainly will not render as expected in .epub!</xsl:message> @@ -1029,9 +1044,15 @@ <xsl:element namespace="http://www.idpf.org/2007/opf" name="item"> <xsl:attribute name="id"> <xsl:choose> - <xsl:when test="(ancestor::mediaobject[@role='cover'] or ancestor::cover) and (../@role='front-large' or count(ancestor::mediaobject/descendant::imageobject) = 1)"> + <xsl:when test="ancestor::mediaobject[@role='cover'] and parent::*[@role='front-large']"> <xsl:value-of select="$epub.cover.image.id"/> </xsl:when> + <xsl:when test="ancestor::mediaobject[@role='cover'] and (count(ancestor::mediaobject//imageobject) = 1)"> + <xsl:value-of select="$epub.cover.image.id"/> + </xsl:when> + <xsl:when test="ancestor::cover"> + <xsl:value-of select="$epub.cover.image.id"/> + </xsl:when> <xsl:otherwise> <xsl:value-of select="generate-id(.)"/> </xsl:otherwise> @@ -1077,9 +1098,15 @@ <xsl:element namespace="http://www.idpf.org/2007/opf" name="item"> <xsl:attribute name="id"> <xsl:choose> - <xsl:when test="(ancestor::mediaobject[@role='cover'] or ancestor::cover) and (../@role='front-large' or count(ancestor::mediaobject/descendant::imageobject) = 1)"> + <xsl:when test="ancestor::mediaobject[@role='cover'] and parent::*[@role='front-large']"> <xsl:value-of select="$epub.cover.image.id"/> </xsl:when> + <xsl:when test="ancestor::mediaobject[@role='cover'] and (count(ancestor::mediaobject//imageobject) = 1)"> + <xsl:value-of select="$epub.cover.image.id"/> + </xsl:when> + <xsl:when test="ancestor::cover"> + <xsl:value-of select="$epub.cover.image.id"/> + </xsl:when> <xsl:otherwise> <xsl:value-of select="generate-id(.)"/> </xsl:otherwise> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abd...@us...> - 2009-10-23 16:13:19
|
Revision: 8528 http://docbook.svn.sourceforge.net/docbook/?rev=8528&view=rev Author: abdelazer Date: 2009-10-23 16:13:02 +0000 (Fri, 23 Oct 2009) Log Message: ----------- Add support for authorgroup/author in OPF metadata (via Michael Wiedmann) Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2009-10-15 19:35:52 UTC (rev 8527) +++ trunk/xsl/epub/docbook.xsl 2009-10-23 16:13:02 UTC (rev 8528) @@ -606,6 +606,10 @@ <!-- override if you care --> </xsl:template> + <xsl:template match="authorgroup" mode="opf.metadata"> + <xsl:apply-templates select="author|corpauthor" mode="opf.metadata"/> + </xsl:template> + <xsl:template match="author|corpauthor" mode="opf.metadata"> <xsl:variable name="n"> <xsl:call-template name="person.name"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abd...@us...> - 2009-11-05 23:04:46
|
Revision: 8531 http://docbook.svn.sourceforge.net/docbook/?rev=8531&view=rev Author: abdelazer Date: 2009-11-05 23:04:33 +0000 (Thu, 05 Nov 2009) Log Message: ----------- Adding param to workaround horrific ADE bug with the inability to process <br> Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2009-11-02 02:38:47 UTC (rev 8530) +++ trunk/xsl/epub/docbook.xsl 2009-11-05 23:04:33 UTC (rev 8531) @@ -51,6 +51,10 @@ <xsl:param name="epub.embedded.fonts"></xsl:param> + <!-- Turning this on crashes ADE, which is unbelievably awesome --> + <xsl:param name="formal.object.break.after">0</xsl:param> + + <!-- Per Bob Stayton: """Process your documents with the css.decoration parameter set to zero. That will avoid the use of style attributes in XHTML elements where they are not permitted.""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abd...@us...> - 2010-07-15 05:28:35
|
Revision: 8723 http://docbook.svn.sourceforge.net/docbook/?rev=8723&view=rev Author: abdelazer Date: 2010-07-15 05:28:28 +0000 (Thu, 15 Jul 2010) Log Message: ----------- Updated mediaobject selection code that better uses roles (when available); based on contributons by Glenn McDonald Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2010-07-14 16:53:51 UTC (rev 8722) +++ trunk/xsl/epub/docbook.xsl 2010-07-15 05:28:28 UTC (rev 8723) @@ -966,25 +966,37 @@ mediaobjectco| inlinemediaobject" mode="opf.manifest"> + + <xsl:variable name="olist" select="imageobject|imageobjectco |videoobject|audioobject |textobject"/> + + <xsl:variable name="object.index"> + <xsl:call-template name="select.mediaobject.index"> + <xsl:with-param name="olist" select="$olist"/> + <xsl:with-param name="count" select="1"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="object" select="$olist[position() = $object.index]"/> + <xsl:choose> - <xsl:when test="imageobject/imagedata[@format = 'GIF' or - @format = 'GIF87a' or - @format = 'GIF89a' or - @format = 'JPEG' or - @format = 'JPG' or - @format = 'PNG' or - @format = 'SVG']"> - <xsl:apply-templates select="imageobject[imagedata[@format = 'GIF' or - @format = 'GIF87a' or - @format = 'GIF89a' or - @format = 'JPEG' or - @format = 'JPG' or - @format = 'PNG' or - @format = 'SVG']][1]/imagedata" + <xsl:when test="$object/descendant::imagedata[@format = 'GIF' or + @format = 'GIF87a' or + @format = 'GIF89a' or + @format = 'JPEG' or + @format = 'JPG' or + @format = 'PNG' or + @format = 'SVG']"> + <xsl:apply-templates select="$object[descendant::imagedata[@format = 'GIF' or + @format = 'GIF87a' or + @format = 'GIF89a' or + @format = 'JPEG' or + @format = 'JPG' or + @format = 'PNG' or + @format = 'SVG']][1]/imagedata" mode="opf.manifest"/> </xsl:when> <xsl:otherwise> - <xsl:apply-templates select="imageobject/imagedata[1]" + <xsl:apply-templates select="$object/imagedata[1]" mode="opf.manifest"/> </xsl:otherwise> </xsl:choose> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abd...@us...> - 2010-09-16 07:04:49
|
Revision: 8909 http://docbook.svn.sourceforge.net/docbook/?rev=8909&view=rev Author: abdelazer Date: 2010-09-16 07:04:43 +0000 (Thu, 16 Sep 2010) Log Message: ----------- Remove unused NCX metadata elements Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2010-09-16 05:07:12 UTC (rev 8908) +++ trunk/xsl/epub/docbook.xsl 2010-09-16 07:04:43 UTC (rev 8909) @@ -364,20 +364,6 @@ <xsl:attribute name="name">dtb:uid</xsl:attribute> <xsl:attribute name="content"><xsl:call-template name="package-identifier"/></xsl:attribute> </xsl:element> - - <xsl:comment>Default values for unused, legacy attributes</xsl:comment> - <xsl:element name="meta" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:attribute name="name">dtb:depth</xsl:attribute> - <xsl:attribute name="content">-1</xsl:attribute> - </xsl:element> - <xsl:element name="meta" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:attribute name="name">dtb:totalPageCount</xsl:attribute> - <xsl:attribute name="content">0</xsl:attribute> - </xsl:element> - <xsl:element name="meta" namespace="http://www.daisy.org/z3986/2005/ncx/"> - <xsl:attribute name="name">dtb:maxPageNumber</xsl:attribute> - <xsl:attribute name="content">0</xsl:attribute> - </xsl:element> </xsl:element> <xsl:choose> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <abd...@us...> - 2010-09-20 04:46:11
|
Revision: 8910 http://docbook.svn.sourceforge.net/docbook/?rev=8910&view=rev Author: abdelazer Date: 2010-09-20 04:46:05 +0000 (Mon, 20 Sep 2010) Log Message: ----------- Bugfix for [#3071521] to ensure that NCX navPoints are generated for d:book root nodes with the -NS version of the stylesheets Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2010-09-16 07:04:43 UTC (rev 8909) +++ trunk/xsl/epub/docbook.xsl 2010-09-20 04:46:05 UTC (rev 8910) @@ -85,6 +85,9 @@ <xsl:when test="/book[*[last()][self::bookinfo]]|book[bookinfo]"> <xsl:text>1</xsl:text> </xsl:when> + <xsl:when test="/book[*[last()][self::info]]|book[info]"> + <xsl:text>1</xsl:text> + </xsl:when> <xsl:when test="/bibliography"> <xsl:text>1</xsl:text> </xsl:when> @@ -247,7 +250,7 @@ </xsl:with-param> <xsl:with-param name="method" select="'xml'" /> <xsl:with-param name="encoding" select="'utf-8'" /> - <xsl:with-param name="indent" select="'yes'" /> + <xsl:with-param name="indent" select="'no'" /> <xsl:with-param name="quiet" select="$chunk.quietly" /> <xsl:with-param name="doctype-public" select="''"/> <!-- intentionally blank --> <xsl:with-param name="doctype-system" select="''"/> <!-- intentionally blank --> @@ -301,7 +304,7 @@ </xsl:with-param> <xsl:with-param name="method" select="'xml'" /> <xsl:with-param name="encoding" select="'utf-8'" /> - <xsl:with-param name="indent" select="'yes'" /> + <xsl:with-param name="indent" select="'no'" /> <xsl:with-param name="quiet" select="$chunk.quietly" /> <xsl:with-param name="doctype-public" select="''"/> <!-- intentionally blank --> <xsl:with-param name="doctype-system" select="''"/> <!-- intentionally blank --> @@ -334,7 +337,7 @@ </xsl:with-param> <xsl:with-param name="method" select="'xml'" /> <xsl:with-param name="encoding" select="'utf-8'" /> - <xsl:with-param name="indent" select="'yes'" /> + <xsl:with-param name="indent" select="'no'" /> <xsl:with-param name="quiet" select="$chunk.quietly" /> <xsl:with-param name="doctype-public" select="''"/> <!-- intentionally blank --> <xsl:with-param name="doctype-system" select="''"/> <!-- intentionally blank --> @@ -1457,7 +1460,7 @@ </xsl:with-param> <xsl:with-param name="method" select="'xml'" /> <xsl:with-param name="encoding" select="'utf-8'" /> - <xsl:with-param name="indent" select="'yes'" /> + <xsl:with-param name="indent" select="'no'" /> <xsl:with-param name="quiet" select="$chunk.quietly" /> <xsl:with-param name="content"> <xsl:element namespace="http://www.w3.org/1999/xhtml" name="html"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2011-09-05 15:50:48
|
Revision: 9049 http://docbook.svn.sourceforge.net/docbook/?rev=9049&view=rev Author: bobstayton Date: 2011-09-05 15:50:41 +0000 (Mon, 05 Sep 2011) Log Message: ----------- Remove disallowed priority attribute from the name="chunk" template. Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2011-09-04 04:53:14 UTC (rev 9048) +++ trunk/xsl/epub/docbook.xsl 2011-09-05 15:50:41 UTC (rev 9049) @@ -1271,8 +1271,7 @@ <!-- OVERRIDES xhtml-1_1/chunk-common.xsl --> <!-- make a bibliography always a chunk --> - <xsl:template name="chunk" - priority="1"> + <xsl:template name="chunk"> <xsl:param name="node" select="."/> <!-- returns 1 if $node is a chunk --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2011-10-07 22:18:59
|
Revision: 9119 http://docbook.svn.sourceforge.net/docbook/?rev=9119&view=rev Author: bobstayton Date: 2011-10-07 22:18:53 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Added support for book/info to support DocBook5. Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2011-10-07 18:39:34 UTC (rev 9118) +++ trunk/xsl/epub/docbook.xsl 2011-10-07 22:18:53 UTC (rev 9119) @@ -787,6 +787,8 @@ <xsl:apply-templates select="//part| //book[*[last()][self::bookinfo]]| //book[bookinfo]| + //book[*[last()][self::info]]| + //book[info]| /set| /set/book| //reference| @@ -1080,6 +1082,8 @@ book[parent::set]| book[*[last()][self::bookinfo]]| book[bookinfo]| + book[*[last()][self::info]]| + book[info]| article| part| reference| This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2011-11-04 17:50:50
|
Revision: 9144 http://docbook.svn.sourceforge.net/docbook/?rev=9144&view=rev Author: bobstayton Date: 2011-11-04 17:50:44 +0000 (Fri, 04 Nov 2011) Log Message: ----------- Match template for "/" must have priority="1" since chunk-code.xsl is xsl:included, not xsl:imported. Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2011-11-01 01:00:59 UTC (rev 9143) +++ trunk/xsl/epub/docbook.xsl 2011-11-04 17:50:44 UTC (rev 9144) @@ -99,7 +99,7 @@ <xsl:key name="image-filerefs" match="graphic|inlinegraphic|imagedata" use="@fileref"/> - <xsl:template match="/"> + <xsl:template match="/" priority="1"> <!-- * Get a title for current doc so that we let the user --> <!-- * know what document we are processing at this point. --> <xsl:variable name="doc.title"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2011-11-12 00:14:08
|
Revision: 9150 http://docbook.svn.sourceforge.net/docbook/?rev=9150&view=rev Author: bobstayton Date: 2011-11-12 00:14:02 +0000 (Sat, 12 Nov 2011) Log Message: ----------- Replace $base.dir with $chunk.base.dir to ensure trailing slash in place. Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2011-11-12 00:12:07 UTC (rev 9149) +++ trunk/xsl/epub/docbook.xsl 2011-11-12 00:14:02 UTC (rev 9150) @@ -331,7 +331,7 @@ <xsl:call-template name="write.chunk"> <xsl:with-param name="filename"> <xsl:if test="$manifest.in.base.dir != 0"> - <xsl:value-of select="$base.dir" /> + <xsl:value-of select="$chunk.base.dir" /> </xsl:if> <xsl:value-of select="$epub.ncx.filename" /> </xsl:with-param> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2013-04-03 17:06:36
|
Revision: 9737 http://docbook.svn.sourceforge.net/docbook/?rev=9737&view=rev Author: bobstayton Date: 2013-04-03 17:06:30 +0000 (Wed, 03 Apr 2013) Log Message: ----------- Fix bug in author template generating a span element inside an attribute value. Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2013-03-30 17:15:25 UTC (rev 9736) +++ trunk/xsl/epub/docbook.xsl 2013-04-03 17:06:30 UTC (rev 9737) @@ -549,9 +549,12 @@ </xsl:variable> <xsl:element name="dc:creator"> <xsl:attribute name="opf:file-as"> - <xsl:call-template name="person.name.last-first"> - <xsl:with-param name="node" select="."/> - </xsl:call-template> + <xsl:variable name="attvalue"> + <xsl:call-template name="person.name.last-first"> + <xsl:with-param name="node" select="."/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$attvalue"/> </xsl:attribute> <xsl:value-of select="normalize-space(string($n))"/> </xsl:element> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tom...@us...> - 2013-04-20 09:15:39
|
Revision: 9749 http://docbook.svn.sourceforge.net/docbook/?rev=9749&view=rev Author: tom_schr Date: 2013-04-20 09:15:28 +0000 (Sat, 20 Apr 2013) Log Message: ----------- Backported Bob's EPUB3 changes to EPUB2 from r9740 -> r9742 -> r9743: * Implement base.dir/OEBPS using internal chunk.base.dir instead of new param epub.base.dir. * Additional changes, specific to this stylesheet: - Construct parameter epub.metainf.dir from base.dir + 'META-INF/' - Changed parameter epub.cover.filename epub.oebps.dir to chunk.base.dir - Template opf: concat base.dir with epub.opf.filename - Replaced two subsequent xsl:value-of's with concat() Revision Links: -------------- http://docbook.svn.sourceforge.net/docbook/?rev=9740&view=rev http://docbook.svn.sourceforge.net/docbook/?rev=9742&view=rev http://docbook.svn.sourceforge.net/docbook/?rev=9743&view=rev Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2013-04-18 08:04:06 UTC (rev 9748) +++ trunk/xsl/epub/docbook.xsl 2013-04-20 09:15:28 UTC (rev 9749) @@ -33,22 +33,48 @@ <xsl:param name="epub.autolabel" select="'1'"/> <xsl:param name="epub.ncx.depth">4</xsl:param> <!-- Not functional until http://code.google.com/p/epubcheck/issues/detail?id=70 is resolved --> - <xsl:param name="manifest.in.base.dir" select="'1'"/> - <xsl:param name="base.dir" select="$epub.oebps.dir"/> + <xsl:param name="base.dir" select="''"/> + <xsl:param name="epub.oebps.dir" select="'OEBPS/'"/> - <xsl:param name="epub.oebps.dir" select="'OEBPS/'"/> + <!-- HTML chunk output goes to $base.dir/OEPBS --> + <xsl:variable name="chunk.base.dir"> + <xsl:if test="$base.dir != '' and contains($base.dir, $epub.oebps.dir)"> + <xsl:message terminate="yes"> + <xsl:text>ERROR: the $base.dir param must not include the </xsl:text> + <xsl:value-of select="$epub.oebps.dir"/> + <xsl:text> directory in its path. Exiting.</xsl:text> + </xsl:message> + </xsl:if> + <xsl:choose> + <xsl:when test="string-length($base.dir) = 0"></xsl:when> + <!-- make sure to add trailing slash if omitted by user --> + <xsl:when test="substring($base.dir, string-length($base.dir), 1) = '/'"> + <xsl:value-of select="$base.dir"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat($base.dir, '/')"/> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$epub.oebps.dir"/> + <xsl:if test="substring($epub.oebps.dir, string-length($epub.oebps.dir), 1) != '/'"> + <xsl:text>/</xsl:text> + </xsl:if> + </xsl:variable> + + <!-- This param only has a side effect of checking for base.dir usage --> + <xsl:param name="epub.ncx.filename" select="'toc.ncx'"/> <xsl:param name="epub.container.filename" select="'container.xml'"/> <xsl:param name="epub.opf.filename" select="concat($epub.oebps.dir, 'content.opf')"/> - <xsl:param name="epub.cover.filename" select="concat($epub.oebps.dir, 'cover', $html.ext)"/> + <xsl:param name="epub.cover.filename" select="concat($chunk.base.dir, 'cover', $html.ext)"/> <xsl:param name="epub.cover.id" select="'cover'"/> <xsl:param name="epub.cover.html" select="'cover.html'" /> <xsl:param name="epub.cover.image.id" select="'cover-image'"/> <xsl:param name="epub.cover.linear" select="0" /> <xsl:param name="epub.ncx.toc.id">ncxtoc</xsl:param> <xsl:param name="epub.html.toc.id">htmltoc</xsl:param> - <xsl:param name="epub.metainf.dir" select="'META-INF/'"/> + <xsl:variable name="epub.metainf.dir" select="concat($base.dir, 'META-INF/')"/> <xsl:param name="epub.embedded.fonts"></xsl:param> @@ -246,7 +272,7 @@ </xsl:variable> <xsl:call-template name="write.chunk"> <xsl:with-param name="filename"> - <xsl:value-of select="$epub.opf.filename" /> + <xsl:value-of select="concat($base.dir, $epub.opf.filename)" /> </xsl:with-param> <xsl:with-param name="method" select="'xml'" /> <xsl:with-param name="encoding" select="'utf-8'" /> @@ -299,8 +325,7 @@ <xsl:template name="container"> <xsl:call-template name="write.chunk"> <xsl:with-param name="filename"> - <xsl:value-of select="$epub.metainf.dir" /> - <xsl:value-of select="$epub.container.filename" /> + <xsl:value-of select="concat($epub.metainf.dir, $epub.container.filename)" /> </xsl:with-param> <xsl:with-param name="method" select="'xml'" /> <xsl:with-param name="encoding" select="'utf-8'" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tom...@us...> - 2013-04-27 20:37:00
|
Revision: 9751 http://docbook.svn.sourceforge.net/docbook/?rev=9751&view=rev Author: tom_schr Date: 2013-04-27 20:36:54 +0000 (Sat, 27 Apr 2013) Log Message: ----------- * Template package-identifier: introduced $info variable to simplify code (similar to the EPUB3 stylesheets) * Template opf.calloutlist: only call opf.reference.callout if callout.graphics is set Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2013-04-24 06:35:21 UTC (rev 9750) +++ trunk/xsl/epub/docbook.xsl 2013-04-27 20:36:54 UTC (rev 9751) @@ -217,54 +217,69 @@ </xsl:choose> </xsl:template> - <xsl:template name="package-identifier"> + <xsl:template name="package-identifier"> + <xsl:variable name="info" select="*/*[contains(local-name(.), 'info')][1]"/> + <xsl:choose> - <xsl:when test="/*/*[contains(name(.), 'info')]/biblioid"> - <xsl:if test="/*/*[contains(name(.), 'info')][1]/biblioid[1][@class = 'doi' or - @class = 'isbn' or - @class = 'isrn' or - @class = 'issn']"> + <xsl:when test="$info/biblioid"> + <xsl:if test="$info/biblioid[1][@class = 'doi' or + @class = 'isbn' or + @class = 'isrn' or + @class = 'issn']"> <xsl:text>urn:</xsl:text> - <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/biblioid[1]/@class"/> + <xsl:value-of select="$info/biblioid[1]/@class"/> <xsl:text>:</xsl:text> </xsl:if> - <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/biblioid[1]"/> + <xsl:value-of select="$info/biblioid[1]"/> </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/isbn"> + <xsl:when test="$info/isbn"> <xsl:text>urn:isbn:</xsl:text> - <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/isbn[1]"/> + <xsl:value-of select="$info/isbn[1]"/> </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/issn"> + <xsl:when test="$info/issn"> <xsl:text>urn:issn:</xsl:text> - <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/issn[1]"/> + <xsl:value-of select="$info/issn[1]"/> </xsl:when> <xsl:otherwise> <xsl:choose> - <xsl:when test="/*/*[contains(name(.), 'info')]/invpartnumber"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/invpartnumber[1]"/> </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/issuenum"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/issuenum[1]"/> </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/productnumber"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/productnumber[1]"/> </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/seriesvolnums"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/seriesvolnums[1]"/> </xsl:when> - <xsl:when test="/*/*[contains(name(.), 'info')]/volumenum"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/volumenum[1]"/> </xsl:when> + <xsl:when test="$info/invpartnumber"> + <xsl:value-of select="$info/invpartnumber[1]"/> + </xsl:when> + <xsl:when test="$info/issuenum"> + <xsl:value-of select="$info[1]/issuenum[1]"/> + </xsl:when> + <xsl:when test="$info/productnumber"> + <xsl:value-of select="$info[1]/productnumber[1]"/> + </xsl:when> + <xsl:when test="$info/seriesvolnums"> + <xsl:value-of select="$info[1]/seriesvolnums[1]"/> + </xsl:when> + <xsl:when test="$info/volumenum"> + <xsl:value-of select="$info[1]/volumenum[1]"/> + </xsl:when> <!-- Deprecated --> - <xsl:when test="/*/*[contains(name(.), 'info')]/pubsnumber"> <xsl:value-of select="/*/*[contains(name(.), 'info')][1]/pubsnumber[1]"/> </xsl:when> + <xsl:when test="$info/pubsnumber"> + <xsl:value-of select="$info[1]/pubsnumber[1]"/> + </xsl:when> </xsl:choose> <xsl:text>_</xsl:text> <xsl:choose> - <xsl:when test="/*/@id"> - <xsl:value-of select="/*/@id"/> + <xsl:when test="@id"> + <xsl:value-of select="@id"/> </xsl:when> - <xsl:when test="/*/@xml:id"> - <xsl:value-of select="/*/@xml:id"/> + <xsl:when test="@xml:id"> + <xsl:value-of select="@xml:id"/> </xsl:when> <xsl:otherwise> <!-- TODO: Do UUIDs here --> - <xsl:value-of select="generate-id(/*)"/> + <xsl:value-of select="generate-id(.)"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> + <xsl:template name="opf"> <xsl:variable name="package-identifier-id"><xsl:value-of select="concat(name(/*), 'id')"/></xsl:variable> <xsl:variable name="doc.title"> @@ -853,7 +868,7 @@ <xsl:with-param name="ext" select="$callout.graphics.extension"/> </xsl:call-template> </xsl:variable> - <xsl:if test="(//calloutlist|//co)"> + <xsl:if test="$callout.graphics != 0 and (//calloutlist|//co)"> <xsl:call-template name="opf.reference.callout"> <xsl:with-param name="conum" select="1"/> <xsl:with-param name="format" select="$format"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tom...@us...> - 2013-05-02 06:32:26
|
Revision: 9756 http://docbook.svn.sourceforge.net/docbook/?rev=9756&view=rev Author: tom_schr Date: 2013-05-02 06:32:20 +0000 (Thu, 02 May 2013) Log Message: ----------- Bugfix in opf.spine: removed double refentry entries Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2013-05-02 06:25:56 UTC (rev 9755) +++ trunk/xsl/epub/docbook.xsl 2013-05-02 06:32:20 UTC (rev 9756) @@ -767,7 +767,7 @@ <xsl:value-of select="generate-id(.)"/> </xsl:attribute> </xsl:element> - <xsl:apply-templates select="*|.//refentry" mode="opf.spine"/> + <xsl:apply-templates select="*" mode="opf.spine"/> </xsl:if> </xsl:template> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tom...@us...> - 2013-05-02 06:33:52
|
Revision: 9757 http://docbook.svn.sourceforge.net/docbook/?rev=9757&view=rev Author: tom_schr Date: 2013-05-02 06:33:45 +0000 (Thu, 02 May 2013) Log Message: ----------- Improved opf.spine with info variable Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2013-05-02 06:32:20 UTC (rev 9756) +++ trunk/xsl/epub/docbook.xsl 2013-05-02 06:33:45 UTC (rev 9757) @@ -711,13 +711,13 @@ </xsl:template> <xsl:template name="opf.spine"> - + <xsl:variable name="info" select="*/*[contains(local-name(.), 'info')][1]"/> <xsl:element namespace="http://www.idpf.org/2007/opf" name="spine"> <xsl:attribute name="toc"> <xsl:value-of select="$epub.ncx.toc.id"/> </xsl:attribute> - <xsl:if test="/*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"> + <xsl:if test="$info/cover or $info//mediaobject[@role='cover' or ancestor::cover]"> <xsl:element namespace="http://www.idpf.org/2007/opf" name="itemref"> <xsl:attribute name="idref"> <xsl:value-of select="$epub.cover.id"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tom...@us...> - 2013-05-02 06:36:34
|
Revision: 9758 http://docbook.svn.sourceforge.net/docbook/?rev=9758&view=rev Author: tom_schr Date: 2013-05-02 06:36:28 +0000 (Thu, 02 May 2013) Log Message: ----------- Improved modularization in opf.spine and created new spine.cover template Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2013-05-02 06:33:45 UTC (rev 9757) +++ trunk/xsl/epub/docbook.xsl 2013-05-02 06:36:28 UTC (rev 9758) @@ -717,23 +717,8 @@ <xsl:value-of select="$epub.ncx.toc.id"/> </xsl:attribute> - <xsl:if test="$info/cover or $info//mediaobject[@role='cover' or ancestor::cover]"> - <xsl:element namespace="http://www.idpf.org/2007/opf" name="itemref"> - <xsl:attribute name="idref"> - <xsl:value-of select="$epub.cover.id"/> - </xsl:attribute> - <xsl:attribute name="linear"> - <xsl:choose> - <xsl:when test="$epub.cover.linear"> - <xsl:text>yes</xsl:text> - </xsl:when> - <xsl:otherwise>no</xsl:otherwise> - </xsl:choose> - </xsl:attribute> - </xsl:element> - </xsl:if> + <xsl:call-template name="spine.cover"/> - <xsl:if test="contains($toc.params, 'toc')"> <xsl:element namespace="http://www.idpf.org/2007/opf" name="itemref"> <xsl:attribute name="idref"> <xsl:value-of select="$epub.html.toc.id"/> </xsl:attribute> @@ -750,9 +735,31 @@ <xsl:apply-templates select="/*/*" mode="opf.spine"/> </xsl:otherwise> </xsl:choose> - </xsl:element> </xsl:template> + + <xsl:template name="spine.cover"> + <xsl:variable name="info" select="*/*[contains(local-name(.), 'info')][1]"/> + <xsl:variable name="cover.image" + select="$info//mediaobject[@role='cover' or ancestor::cover]"/> + + <xsl:if test="$cover.image"> + <xsl:element namespace="http://www.idpf.org/2007/opf" name="itemref"> + <xsl:attribute name="idref"> + <xsl:value-of select="$epub.cover.id"/> + </xsl:attribute> + <xsl:attribute name="linear"> + <xsl:choose> + <xsl:when test="$epub.cover.linear"> + <xsl:text>yes</xsl:text> + </xsl:when> + <xsl:otherwise>no</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + </xsl:element> + </xsl:if> + </xsl:template> + <xsl:template match="*" mode="opf.spine"> <xsl:variable name="is.chunk"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tom...@us...> - 2013-05-02 06:38:05
|
Revision: 9759 http://docbook.svn.sourceforge.net/docbook/?rev=9759&view=rev Author: tom_schr Date: 2013-05-02 06:37:59 +0000 (Thu, 02 May 2013) Log Message: ----------- Introduced variable in opf.guide Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2013-05-02 06:36:28 UTC (rev 9758) +++ trunk/xsl/epub/docbook.xsl 2013-05-02 06:37:59 UTC (rev 9759) @@ -682,10 +682,13 @@ </xsl:template> <xsl:template name="opf.guide"> + <xsl:variable name="info" select="*/*[contains(local-name(.), 'info')][1]"/> + <xsl:if test="contains($toc.params, 'toc') or - /*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"> + $info/cover or + $info//mediaobject[@role='cover' or ancestor::cover]"> <xsl:element namespace="http://www.idpf.org/2007/opf" name="guide"> - <xsl:if test="/*/*[cover or contains(name(.), 'info')]//mediaobject[@role='cover' or ancestor::cover]"> + <xsl:if test="$info/cover or $info//mediaobject[@role='cover' or ancestor::cover]"> <xsl:element namespace="http://www.idpf.org/2007/opf" name="reference"> <xsl:attribute name="href"> <xsl:value-of select="$epub.cover.html" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tom...@us...> - 2013-10-21 06:58:05
|
Revision: 9823 http://sourceforge.net/p/docbook/code/9823 Author: tom_schr Date: 2013-10-21 06:58:03 +0000 (Mon, 21 Oct 2013) Log Message: ----------- Extended date template in mode opf.metadata If a PI dbtimestamp is available, call datetime.format(date, 'Y-m-d'), otherwise use the normalized string content Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2013-10-19 00:45:49 UTC (rev 9822) +++ trunk/xsl/epub/docbook.xsl 2013-10-21 06:58:03 UTC (rev 9823) @@ -9,11 +9,12 @@ xmlns:opf="http://www.idpf.org/2007/opf" xmlns:stext="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.TextFactory" xmlns:str="http://exslt.org/strings" + xmlns:date="http://exslt.org/dates-and-times" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtext="xalan://com.nwalsh.xalan.Text" - extension-element-prefixes="stext xtext" - exclude-result-prefixes="exsl db dc h ncx ng opf stext str xtext" + extension-element-prefixes="date stext xtext" + exclude-result-prefixes="exsl date db dc h ncx ng opf stext str xtext" version="1.0"> @@ -602,7 +603,28 @@ <xsl:template match="date" mode="opf.metadata"> <xsl:element name="dc:date"> - <xsl:value-of select="normalize-space(string(.))"/> + <xsl:choose> + <xsl:when test="processing-instruction('dbtimestamp')"> + <xsl:call-template name="datetime.format"> + <xsl:with-param name="date"> + <xsl:choose> + <xsl:when test="function-available('date:date-time')"> + <xsl:value-of select="date:date-time()"/> + </xsl:when> + <xsl:when test="function-available('date:dateTime')"> + <!-- Xalan quirk --> + <xsl:value-of select="date:dateTime()"/> + </xsl:when> + </xsl:choose> + </xsl:with-param> + <!-- We need an ISO date --> + <xsl:with-param name="format">Y-m-d</xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space(string(.))"/> + </xsl:otherwise> + </xsl:choose> </xsl:element> </xsl:template> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bob...@us...> - 2014-02-17 18:03:39
|
Revision: 9901 http://sourceforge.net/p/docbook/code/9901 Author: bobstayton Date: 2014-02-17 18:03:34 +0000 (Mon, 17 Feb 2014) Log Message: ----------- Fix the namespace fixup step to match the other stylesheets. Modified Paths: -------------- trunk/xsl/epub/docbook.xsl Modified: trunk/xsl/epub/docbook.xsl =================================================================== --- trunk/xsl/epub/docbook.xsl 2014-02-17 17:25:27 UTC (rev 9900) +++ trunk/xsl/epub/docbook.xsl 2014-02-17 18:03:34 UTC (rev 9901) @@ -133,15 +133,12 @@ <xsl:call-template name="get.doc.title" /> </xsl:variable> <xsl:choose> - <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document, - toss the namespace and continue. Use the docbook5 namespaced - stylesheets for DocBook5 if you don't want to use this feature.--> - <!-- include extra test for Xalan quirk --> - <xsl:when test="$exsl.node.set.available != 0 - and (*/self::ng:* or */self::db:*)"> + <!-- fix namespace if necessary --> + <xsl:when test="$exsl.node.set.available != 0 and + namespace-uri(/*) = 'http://docbook.org/ns/docbook'"> <xsl:call-template name="log.message"> <xsl:with-param name="level">Note</xsl:with-param> - <xsl:with-param name="source" select="$doc.title" /> + <xsl:with-param name="source" select="$doc.title"/> <xsl:with-param name="context-desc"> <xsl:text>namesp. cut</xsl:text> </xsl:with-param> @@ -149,21 +146,25 @@ <xsl:text>stripped namespace before processing</xsl:text> </xsl:with-param> </xsl:call-template> - <xsl:variable name="nons"> - <xsl:apply-templates mode="stripNS" /> - </xsl:variable> - <xsl:call-template name="log.message"> - <xsl:with-param name="level">Note</xsl:with-param> - <xsl:with-param name="source" select="$doc.title" /> - <xsl:with-param name="context-desc"> - <xsl:text>namesp. cut</xsl:text> + <!-- DEBUG: uncomment to save namespace-fixed document. + <xsl:message>Saving namespace-fixed document.</xsl:message> + <xsl:call-template name="write.chunk"> + <xsl:with-param name="filename" select="'namespace-fixed.debug.xml'"/> + <xsl:with-param name="method" select="'xml'"/> + <xsl:with-param name="content"> + <xsl:copy-of select="exsl:node-set($no.namespace)"/> </xsl:with-param> - <xsl:with-param name="message"> - <xsl:text>processing stripped document</xsl:text> - </xsl:with-param> </xsl:call-template> - <xsl:apply-templates select="exsl:node-set($nons)" /> + --> + <xsl:apply-templates select="exsl:node-set($no.namespace)"/> </xsl:when> + <!-- Can't process unless namespace fixed with exsl node-set()--> + <xsl:when test="namespace-uri(/*) = 'http://docbook.org/ns/docbook'"> + <xsl:message terminate="yes"> + <xsl:text>Unable to strip the namespace from DB5 document,</xsl:text> + <xsl:text> cannot proceed.</xsl:text> + </xsl:message> + </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$rootid != ''"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |