RE: [xsl] checking sequential element

Subject: RE: [xsl] checking sequential element
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 31 Dec 2008 09:20:59 -0000
> I want to test the presence of <delim/> tag after </citau> in 
> the below example. If it is missing the XSL should raise an error.
> <citref id="bib12">
>  <citaug>
>  <citau>
>    <citsname>Ferri</citsname>
>    <delim/>
>    <citfnames>E</citfnames>
>  </citau>
>  <delim/>
>  <cittext>(ed.).</cittext>
> </citaug>
> I have tried the following code but i am not getting the 
> required result.
> <xsl:template match="citref">
>  <xsl:if test="citau/following-sibling::*[1]/self::delim">
>   <xsl:message>citau does not followed by delim</xsl:message> 
>  </xsl:if> </xsl:template>

The citau element is not a child of citref, but a grandchild. Perhaps you
were misled by the poor indentation.

Michael Kay

Current Thread