This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Including OS Version information on DocBook elements


If you keep your version numbers 'cleanish' so that
xslt can use them, then it will handle various constructs
to keep the output 'clean' to a version.
Example below.

HTH DaveP

<document>
<title>Here goes the title</title>
<sect>
<vsn>rev2.1</vsn>
  </sect>

<sect>
<vsn>rev2.2</vsn>
  </sect>
</document>

 <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output method="text"/>
   <xsl:template match="document">

     <xsl:variable name="rev1"
select="number(substring-after(sect[1]/vsn,'rev'))"/>
     <xsl:variable name="rev2"
select="number(substring-after(sect[2]/vsn,'rev'))"/>

     <xsl:if test="$rev2 > $rev1">
       <xsl:value-of select="$rev1"/>
        <xsl:value-of select="$rev2"/>
       <xsl:text>Rev 2 greater than rev 1</xsl:text>
     </xsl:if>

   </xsl:template>

</xsl:stylesheet>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]