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

Re: [xsl] XML Elements to XML Attributes


Subject: Re: [xsl] XML Elements to XML Attributes
From: Florent Georges <darkman_spam@xxxxxxxx>
Date: Sun, 14 Jan 2007 15:37:11 +0100 (CET)

Andrew Franz wrote:

  Hi

> <xsl:template match="td" />
> <xsl:template match="td[(position() mod 4) = 0]">
> <entry      tag="{.}"
>         attribute="{following-sibling::td[1]}"
>               type="{following-sibling::td[2]}"
>     description="{following-sibling::td[3]}" />
> </xsl:template>

  This is not the same thing as the OP's code.  That will result in an
error if there is more than 4 td elements, because that will generate
two attributes with the same name in the same element.

  I'd just say, in the same context as the OP's code:

    <entry
        tag="{ td[1] }"
        attribute="{ td[2] }"
        type="{ td[3] }"
        description="{ td[4] }"/>

  Regards,

--drkm






















	

	
		
___________________________________________________________________________ 
Dicouvrez une nouvelle fagon d'obtenir des riponses ` toutes vos questions ! 
Profitez des connaissances, des opinions et des expiriences des internautes sur Yahoo! Questions/Riponses 
http://fr.answers.yahoo.com


Current Thread