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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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


Subject: Re: [docbook] Selecting the last para in a CAUTION


Hi there,

I suspect this XPath doesn't select anything:

ancestor-or-self::warning/para[position()=last()]

Your warning element doesn't contain any children which are para 
elements. Do I misunderstand, or do you need to do something like this?

ancestor-or-self::warning//para[position()=last()]

Cheers,
Martin

David White wrote:
> Hell all,
> 
> I have a bit of code thats giving me grief:
> 
> <warning  role="danger" conformance="0000055">
> 
> <title  lang="en">EXPLOSION!</title>
> 
> <itemizedlist>
> 
> <listitem>
> 
> <para  lang="en">blah<para>
> 
> </listitem>
> 
> <listitem>
> 
> <para  lang="en">blah</para>
> 
> </listitem>
> 
> </itemizedlist>
> 
> <para  lang="en">0000007en</para>
> 
> </warning>
> 
>  
> 
> Here is my XSLT code:
> 
>  
> 
> <xsl:choose>
> 
> <xsl:when test="ancestor-or-self::warning/para[position()=last()]">
> 
> <fo:block xsl:use-attribute-sets="admonition.insert_number.properties" >
> 
> <xsl:apply-templates/>
> 
> </fo:block>
> 
> <xsl:otherwise>
> 
> <fo:block xsl:use-attribute-sets="admonition.properties">
> 
> <xsl:apply-templates/>
> 
> </fo:block>
> 
> </xsl:otherwise>
> 
> </xsl:choose>
> 
>  
> 
> I want the XSLT code to only apply admonition.insert_number.properties 
> to the LAST /warning/para element or the ONLY /warning/para element if 
> there is only 1.
> 
> What this does is it sees the /listitem/para elements and formats them 
> as the last element and gives them admonition.insert_number.properties 
> when they should be just the admoninition.properties set instead.
> 
> Thanks,
> 
> David White
> 

-- 
Martin Holmes
University of Victoria Humanities Computing and Media Centre
(mholmes@uvic.ca)
Half-Baked Software, Inc.
(mholmes@halfbakedsoftware.com)
martin@mholmes.com


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