Create dynamic links using XSL
I want to create a dynamic link on a web page created from XSL containing
the value from the XML data.
This is how I would like to be able to do it, but it won't let me embed tags
like this
<a href="MyPage.asp?value=<xsl:value-of select="datavalue" /> > <xsl:value-of
select="datavalue" /></a>
the final result looking like this...
<a href="MyPage.asp?value=32>32</a>
is there another way to get to my final result using XML and XSL...?
Thanks!
Curt
[550 byte] By [
Curt] at [2007-11-9 15:23:28]

# 1 Re: Create dynamic links using XSL
Curt -
You want to take a look at the attribute directive.
<a>
<xsl:attribute name="href">MmsExecutive? event=editplanrep<xsl:value-of select="REP_NUM"
/>&empernum=<xsl:value-of select="EMP_ER_NUM" />
</xsl:attribute>Edit</a>
Best of Luck,
Rick
"Curt" <xml.@127.0.0.1> wrote:
>
>
> I want to create a dynamic link on a web page created from XSL containing
>the value from the XML data.
>
>This is how I would like to be able to do it, but it won't let me embed
tags
>like this
> <a href="MyPage.asp?value=<xsl:value-of select="datavalue" /> > <xsl:value-of
>select="datavalue" /></a>
>
>the final result looking like this...
> <a href="MyPage.asp?value=32>32</a>
>
> is there another way to get to my final result using XML and XSL...?
>
> Thanks!
> Curt
Rick at 2007-11-11 23:30:12 >

# 2 Re: Create dynamic links using XSL
Oh Thank You! I knew it shouldn't be that hard, but for some reason I could
not find an example. Works like a charm.
"Rick" <rsteinberger@icmarc.org> wrote:
>
>
>Curt -
>
>You want to take a look at the attribute directive.
>
><a>
><xsl:attribute name="href">MmsExecutive? event=editplanrep<xsl:value-of
select="REP_NUM"
>/>&empernum=<xsl:value-of select="EMP_ER_NUM" />
></xsl:attribute>Edit</a>
>
>Best of Luck,
>Rick
>
>
>"Curt" <xml.@127.0.0.1> wrote:
>>
>>
>> I want to create a dynamic link on a web page created from XSL containing
>>the value from the XML data.
>>
>>This is how I would like to be able to do it, but it won't let me embed
>tags
>>like this
>> <a href="MyPage.asp?value=<xsl:value-of select="datavalue" /> > <xsl:value-of
>>select="datavalue" /></a>
>>
>>the final result looking like this...
>> <a href="MyPage.asp?value=32>32</a>
>>
>> is there another way to get to my final result using XML and XSL...?
>>
>> Thanks!
>> Curt
>
Curt at 2007-11-11 23:31:18 >

# 3 Re: Create dynamic links using XSL
"Curt" <xml.@127.0.0.1> wrote:
>
> Oh Thank You! I knew it shouldn't be that hard, but for some reason I could
>not find an example. Works like a charm.
>
>"Rick" <rsteinberger@icmarc.org> wrote:
>>
>>
>>Curt -
>>
>>You want to take a look at the attribute directive.
>>
>><a>
>><xsl:attribute name="href">MmsExecutive? event=editplanrep<xsl:value-of
>select="REP_NUM"
>>/>&empernum=<xsl:value-of select="EMP_ER_NUM" />
>></xsl:attribute>Edit</a>
>>
>>Best of Luck,
>>Rick
>>
>>
>>"Curt" <xml.@127.0.0.1> wrote:
>>>
>>>
>>> I want to create a dynamic link on a web page created from XSL containing
>>>the value from the XML data.
>>>
>>>This is how I would like to be able to do it, but it won't let me embed
>>tags
>>>like this
>>> <a href="MyPage.asp?value=<xsl:value-of select="datavalue" /> > <xsl:value-of
>>>select="datavalue" /></a>
>>>
>>>the final result looking like this...
>>> <a href="MyPage.asp?value=32>32</a>
>>>
>>> is there another way to get to my final result using XML and XSL...?
>>>
>>> Thanks!
>>> Curt
>>
>
at 2007-11-11 23:32:21 >

# 4 Re: Create dynamic links using XSL
you may want try this:
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:text>MyPage.asp?value=</xsl:text>
<xsl:value-of select="datavalue"/>
</xsl:attribute>
<xsl:value-of select="datavalue"/>
</xsl:element>
Good luck
victor
"Curt" <xml.@127.0.0.1> wrote:
>
>
> I want to create a dynamic link on a web page created from XSL containing
>the value from the XML data.
>
>This is how I would like to be able to do it, but it won't let me embed
tags
>like this
> <a href="MyPage.asp?value=<xsl:value-of select="datavalue" /> > <xsl:value-of
>select="datavalue" /></a>
>
>the final result looking like this...
> <a href="MyPage.asp?value=32>32</a>
>
> is there another way to get to my final result using XML and XSL...?
>
> Thanks!
> Curt
victor at 2007-11-11 23:33:21 >

# 5 Re: Create dynamic links using XSL
Is there any limit to the number of characters that can be added by the <xsl:attribute>
or the <xsl:element> ?
I am trying to add an "href" attribute that is fairly long and the data is
being truncated.
I have tried something like the following:
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:text>xsltsheetinfo.asp?SheetInfoID=</xsl:text>
<xsl:value-of select="@SheetInfoID" />
<xsl:text>&AID=</xsl:text>
<xsl:value-of select="ArchiveInfo/@AID" />
<xsl:text>&PID=</xsl:text>
<xsl:value-of select="PlotSetAttributes/@PID"/>
<xsl:text>&SID=</xsl:text>
<xsl:value-of select="SheetAttributes/@SID" />
<xsl:text>&action=</xsl:text>
<xsl:value-of select="$Action" />
</xsl:attribute>Remove
</xsl:element>
The link is truncated when the "action" parameter is added. I only get part
of the information that I am passing for "action". There are only about 125
characters of information in my link.
Thanks,
Gil
Any
"victor" <victorz2000@hotmail.com> wrote:
>
>you may want try this:
><xsl:element name="a">
> <xsl:attribute name="href">
> <xsl:text>MyPage.asp?value=</xsl:text>
> <xsl:value-of select="datavalue"/>
> </xsl:attribute>
> <xsl:value-of select="datavalue"/>
></xsl:element>
>
>Good luck
>victor
>
>"Curt" <xml.@127.0.0.1> wrote:
>>
>>
>> I want to create a dynamic link on a web page created from XSL containing
>>the value from the XML data.
>>
>>This is how I would like to be able to do it, but it won't let me embed
>tags
>>like this
>> <a href="MyPage.asp?value=<xsl:value-of select="datavalue" /> > <xsl:value-of
>>select="datavalue" /></a>
>>
>>the final result looking like this...
>> <a href="MyPage.asp?value=32>32</a>
>>
>> is there another way to get to my final result using XML and XSL...?
>>
>> Thanks!
>> Curt
>
# 6 Re: Create dynamic links using XSL
"Gil Clayton" <gil.clayton@bentley.com> wrote in message
news:3cc481b4$1@10.1.10.29...
>
> Is there any limit to the number of characters that can be added by the
<xsl:attribute>
> or the <xsl:element> ?
As far as I know, there's not. Look for spaces in your $Action parameter.
Try substituting %20 for each space you find before adding the value to the
attribute. Some browsers don't handle spaces in URLs.
# 7 Re: Create dynamic links using XSL
Sod that **** - what you need to do is this:
<a href="MyPage.asp?value={datavalue}"><xsl:value-of select="datavalue"
/></a>
If you put some {} in the attribute of an html tag, you are in XPath
k-tech
--
www.globalkeith.com
www.ceeph.com
--
<xml.@127.0.0.1> wrote in message news:3cc00c34$1@10.1.10.29...
>
> "Curt" <xml.@127.0.0.1> wrote:
> >
> > Oh Thank You! I knew it shouldn't be that hard, but for some reason I
could
> >not find an example. Works like a charm.
> >
> >"Rick" <rsteinberger@icmarc.org> wrote:
> >>
> >>
> >>Curt -
> >>
> >>You want to take a look at the attribute directive.
> >>
> >><a>
> >><xsl:attribute name="href">MmsExecutive? event=editplanrep<xsl:value-of
> >select="REP_NUM"
> >>/>&empernum=<xsl:value-of select="EMP_ER_NUM" />
> >></xsl:attribute>Edit</a>
> >>
> >>Best of Luck,
> >>Rick
> >>
> >>
> >>"Curt" <xml.@127.0.0.1> wrote:
> >>>
> >>>
> >>> I want to create a dynamic link on a web page created from XSL
containing
> >>>the value from the XML data.
> >>>
> >>>This is how I would like to be able to do it, but it won't let me embed
> >>tags
> >>>like this
> >>> <a href="MyPage.asp?value=<xsl:value-of select="datavalue" /> >
<xsl:value-of
> >>>select="datavalue" /></a>
> >>>
> >>>the final result looking like this...
> >>> <a href="MyPage.asp?value=32>32</a>
> >>>
> >>> is there another way to get to my final result using XML and XSL...?
> >>>
> >>> Thanks!
> >>> Curt
> >>
> >
>
