Subject: RE: [xsl] forming a link w/ arguments? From: "Chris Bayes" <chris@xxxxxxxxxxx> Date: Tue, 13 Nov 2001 14:38:14 -0000 |
And for a non for-each version <xsl:template match="LINK"> <a><xsl:attribute name="href"> <xsl:value-of select="BASE"/>?<xsl:apply-templates select="ARG" /> </xsl:attribute> <xsl:value-of select="TEXT"/> </a> </xsl:template> <xsl:template match="ARG"> <xsl:if test="count(preceding-sibling::*) > 1">&</xsl:if> <xsl:value-of select="concat(@NAME, '=', @VALUE)"/> </xsl:template> Ciao Chris XML/XSL Portal http://www.bayes.co.uk/xml > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Michael > Sent: 13 November 2001 12:10 > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] forming a link w/ arguments? > > > I've been trying to figure out how I might turn this.. > > <LINK> > <BASE>http://mysite.com/index.php</BASE> > <ARG NAME="image_id" VALUE="3"/> > <ARG NAME="search_id" VALUE="6"/> > <ARG NAME="page" VALUE="1"/> > <TEXT>My link</TEXT> > </LINK> > > into.. > > <A > HREF="mysite.com/index.php?image_id=3&search_id=6&page=1">My link</A> > > Of course there can be any number of args and their names > depend upon what part of the program the link is working > with. The part I seem to be having trouble with is generating > the arguments. I can do a fixed number but am not sure how to > work multiple instances inside an argument. > > Thanks. > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] forming a link w/ argumen, Michael Kay | Thread | RE: [xsl] forming a link w/ argumen, Jarno . Elovirta |
Re: [xsl] Calling a template dynami, Alessio Mazzieri | Date | Re: [xsl] Calling a template dynami, David Carlisle |
Month |