[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: DOCBOOK-APPS: XSL Stylesheet Problems passing formal.procedures toprocedure template
I am writing a customization layer for Norm's stylesheets v1.45 and am running into a problem with the procedure template. My XSL stylesheet is: <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0' xmlns="http://www.w3.org/TR/xhtml1/transitional" exclude-result-prefixes="#default"> <!-- Importing the Norman Walsh's stylesheet as the basis. --> <xsl:import href="/usr/share/sgml/docbook/stylesheet/xsl/nwalsh-1.45/html/docbook.xsl"/> <xsl:template match="procedure"> <xsl:choose> <xsl:when test="@role='informal'"> <xsl:call-template name="a.procedure"> <xsl:with-param name="formal.procedures" select="0"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="a.procedure"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="a.procedure"> <div class="{name(.)}"> <xsl:call-template name="anchor"/> <xsl:if test="title or $formal.procedures !=0"> <xsl:call-template name="formal.object.heading"/> </xsl:if> <xsl:apply-templates select="*[local-name()!='step']"/> <ol> <xsl:attribute name="type"> <xsl:value-of select="substring($procedure.step.numeration.formats,1,1)"/> </xsl:attribute> <xsl:apply-templates select="step"/> </ol> </div> </xsl:template> </xsl:stylesheet> The source file is: <!DOCTYPE procedure PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> <procedure role="informal"><title>An Example Procedure</title> <step> <para> A Step </para> </step> <step> <para> Another Step </para> <substeps> <step> <para> Substeps can be nested indefinitely deep. </para> </step> </substeps> </step> <step> <para> A Final Step </para> </step> </procedure> The HTML file I get when I process the source with the stylesheet using xsltproc is: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title>Procedure 1. An Example Procedure</title> <meta name="generator" content="DocBook XSL Stylesheets V1.45"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="procedure"> <p><b>Procedure 1. An Example Procedure</b></p> <ol type="1"> <li><p> A Step </p></li> <li> <p> Another Step </p> <ol type="a"><li><p> Substeps can be nested indefinitely deep. </p></li></ol> </li> <li><p> A Final Step </p></li> </ol> </div></body> </html> The HTML code I want to get is: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> <title>Procedure 1. An Example Procedure</title> <meta name="generator" content="DocBook XSL Stylesheets V1.45"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="procedure"> <p><b>An Example Procedure</b></p> <ol type="1"> <li><p> A Step </p></li> <li> <p> Another Step </p> <ol type="a"><li><p> Substeps can be nested indefinitely deep. </p></li></ol> </li> <li><p> A Final Step </p></li> </ol> </div></body> </html> Can anyone tell me why the stylesheet won't work. If I just set the parameter formal.procedures to zero it works correctly, but that doesn't depend on the role attribute in the procedure tag. I would like to be able to use formal and informal procedures the source. (I'm not worrying about the numbering of the procedure atm.) Any help is greatly appreciated. Eric Baudais
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC