[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

XSL and XML in querystring

Posted on 2005-04-15
1
Medium Priority
?
1,200 Views
Last Modified: 2008-03-04
I need to loop and take <xsl:value-of select="@NAME"/>
then insert it into hyperlink like below, how do I do that?

<a href="remove.asp?value=INSERT_XSLVARIABLE_HERE">

below is a simplified version from my problem:

-- myASP ---
<%
  set kk_xmlDoc = CreateObject("Microsoft.XMLDOM")
  if (kk_xmlDoc.load("myXML.xml")) then

  'Load the XSL
  set myxsl = CreateObject("Microsoft.XMLDOM")
  myxsl.async = false
  myxsl.load("myXSL.xsl")
 
  set myXML1 = kk_xmlDoc.selectSingleNode("/DATA/BODY")

 response.write myXML1.transformNode(myxsl)
%>


--- myXML ---
<?xml version="1.0"?>
<DATA>
      <BODY>
            <ITEM VALUE="moron"/>
            <ITEM VALUE="stupid"/>
            <ITEM VALUE="idiot"/>
  </BODY>
</DATA>


--- myXSL ---
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/DATA/BODY">
  <table>
    <xsl:for-each select="ITEM">
        <tr class="MessageCell0">
          <td><a href="remove.asp?value="><xsl:value-of select="@NAME"/></a></td>
        </tr>
    </xsl:for-each>
  </table>
</xsl:template>
</xsl:stylesheet>
0
Comment
Question by:calvinfoo
1 Comment
 
LVL 23

Accepted Solution

by:
adathelad earned 500 total points
ID: 13788969
Hi,

Try changing this:
<td><a href="remove.asp?value="><xsl:value-of select="@NAME"/></a></td>

to this:
<td><a>
    <xsl:attribute name="href">remove.asp?value=<xsl:value-of select="@NAME"/></xsl:attribute>
</a></td>
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question