469,343 Members | 5,388 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,343 developers. It's quick & easy.

passing url in xslt file

I just want to pass the below URL in my xslt file.

<a href="http://testwebi/testlite/admin/remoteMgmt.aspx?id=<xsl:value-of
select="indexID"/>&action=1">

i keep geeting errors whn i am trying to pass this url, but if i change the
url to below url

<a href="http://testwebi/testlite/admin/remoteMgmt.aspx?id=12/>&action=1">

then it works fine. I just need to pass the database value to the url. The
datbase value will come in <xsl:value-of select="indexID"/>.

Please let me know if it is possible.

Thanks.
--
vinki
Jan 25 '07 #1
4 8551
vinki wrote:
I just want to pass the below URL in my xslt file.

<a href="http://testwebi/testlite/admin/remoteMgmt.aspx?id=<xsl:value-of
select="indexID"/>&action=1">
XSLT is XML, so it must be well-formed. You can't put "<" in an
attribute value in XML; and the "&" must be given as "&amp;"

<a>
<xsl:attribute name="href">
<xsl:text>http://testwebi/testlite/admin/remoteMgmt.aspx?id=</xsl:text>
<xsl:value-of select="indexID"/>
<xsl:text>&amp;action=1</xsl:text>
</xsl:attribute>
stuff
</a>

///Peter
--
XML FAQ: http://xml.silmaril.ie/

Jan 25 '07 #2
Peter Flynn wrote:
vinki wrote:
>I just want to pass the below URL in my xslt file.
<a
href="http://testwebi/testlite/admin/remoteMgmt.aspx?id=<xsl:value-of
select="indexID"/>&action=1">

XSLT is XML, so it must be well-formed. You can't put "<" in an
attribute value in XML; and the "&" must be given as "&amp;"

<a>
<xsl:attribute name="href">
<xsl:text>http://testwebi/testlite/admin/remoteMgmt.aspx?id=</xsl:text>
<xsl:value-of select="indexID"/>
<xsl:text>&amp;action=1</xsl:text>
</xsl:attribute>
stuff
</a>
Or use an attribute value template

<a
href="http://testwebi/testlite/admin/remoteMgmt.aspx?id={indexID}&amp;action=1">stuff</a>

///Peter
Jan 25 '07 #3
Hello Peter,

I am a newbie in xslt files. I just took your peice of code and save that
file as test.xsl and tried to display it in the browser. I got this error

Reference to undeclared namespace prefix: 'xsl'. Error processing resource
'file:///C:/Documents and Settings/U311770/Deskt...

<xsl:attribute name="href">

below is the file text

<a>
<xsl:attribute name="href">
<xsl:text>http://testwebi/testlite/admin/remoteMgmt.aspx?id=</xsl:text>
<xsl:value-of select="indexID"/>
<xsl:text>&action=1</xsl:text>
</xsl:attribute>

</a>

am I doing something wrong.

Thanks.
--
vinki
"Peter Flynn" wrote:
Peter Flynn wrote:
vinki wrote:
I just want to pass the below URL in my xslt file.
<a
href="http://testwebi/testlite/admin/remoteMgmt.aspx?id=<xsl:value-of
select="indexID"/>&action=1">
XSLT is XML, so it must be well-formed. You can't put "<" in an
attribute value in XML; and the "&" must be given as "&"

<a>
<xsl:attribute name="href">
<xsl:text>http://testwebi/testlite/admin/remoteMgmt.aspx?id=</xsl:text>
<xsl:value-of select="indexID"/>
<xsl:text>&action=1</xsl:text>
</xsl:attribute>
stuff
</a>

Or use an attribute value template

<a
href="http://testwebi/testlite/admin/remoteMgmt.aspx?id={indexID}&action=1">stuff</a>

///Peter
Jan 25 '07 #4
Thanks Peter, It worked!!.

Thanks again
--
vinki
"Peter Flynn" wrote:
Peter Flynn wrote:
vinki wrote:
I just want to pass the below URL in my xslt file.
<a
href="http://testwebi/testlite/admin/remoteMgmt.aspx?id=<xsl:value-of
select="indexID"/>&action=1">
XSLT is XML, so it must be well-formed. You can't put "<" in an
attribute value in XML; and the "&" must be given as "&"

<a>
<xsl:attribute name="href">
<xsl:text>http://testwebi/testlite/admin/remoteMgmt.aspx?id=</xsl:text>
<xsl:value-of select="indexID"/>
<xsl:text>&action=1</xsl:text>
</xsl:attribute>
stuff
</a>

Or use an attribute value template

<a
href="http://testwebi/testlite/admin/remoteMgmt.aspx?id={indexID}&action=1">stuff</a>

///Peter
Jan 26 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Richard L Rosenheim | last post: by
reply views Thread by Ganesh Kolappan via .NET 247 | last post: by
4 posts views Thread by Isambella via DotNetMonster.com | last post: by
1 post views Thread by Max Evans | last post: by
1 post views Thread by vinki | last post: by
1 post views Thread by suratna | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.