[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] handling tags and PIs within a macro


Subject: Re: [xsl] handling tags and PIs within a macro
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Mon, 29 Oct 2007 14:46:01 +0100 (CET)

David Carlisle wrote:

  Hi

>>   is it possible to state in the template that when
>>   there is no <fid> element, the corresponding
>>   formalpara has no ID?

> don't do 
>  <formalpara id="{fid}">

> do
> <formalpara>
>  <xsl:if test="fid">
>   <xsl:attribute name="id"><xsl:value-of select="cid"/>

  Or from another school of thought:

    <formalpara>
       <xsl:apply-templates select="fid"/>

with:

    <xsl:template match="fid" as="attribute(id)">
       <xsl:attribute name="id" select="string(.)"/>
    </>

has its own advantages too.

  Regards,

--drkm
























      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 


Current Thread