xsl-list
[Top] [All Lists]

Re: ID of HTML control must have value of XML tag

2003-04-05 13:21:00
At 09:06 PM 4/5/03 +0200, you wrote:
In an XSL-template I try to create a HTML weblink (<a href=... id=...>).
The link must have an ID that has the value of an XML-tag.
How can I do that?

<xsl:template match="Person">
<a href="http://www.somewebpage.com"; id="???"><xsl:value-of select="Nr"/></a>
</xsl:template>

i am a newbie, but i think you need to do it this way using xsl:element and xsl:attribute

                                <xsl:element name="label">
<xsl:attribute name="for"><xsl:value-of select="name()"/></xsl:attribute>
                                        <xsl:value-of select="name()"/>
                                </xsl:element>
                                <xsl:element name="input">
<xsl:attribute name="type">text</xsl:attribute> <xsl:attribute name="size">4</xsl:attribute> <xsl:attribute name="id"><xsl:value-of select="name()"/></xsl:attribute> <xsl:attribute name="name"><xsl:value-of select="$path"/></xsl:attribute> <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
                                </xsl:element>

hth

---
ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work
vice chair orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>