X
xmlhelp
stuff.XSL:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl
aram name="uid"/>
<xsl:template match="/">
parameter UID=<xsl:value-of select="$uid"/>
<table border="1">
<tr>
<xsl:for-each select="row[data[3]/value=20]">
<td>
<xsl:value-of select="data[1]/value"/>
<xsl:value-of select="data[2]/value"/>
</td>
</xsl:for-each>
</tr></table>
</xsl:template></xsl:stylesheet>
stuff.XML:
<row>
<data>
<value>NAME</value>
</data>
<data>
<value>DATA</value>
</data>
<data>
<value>20</value>
</data>
stuff.asp:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include
file="includes/MM_XSLTransform/MM_XSLTransform.classVB.asp"
--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>XML</title>
</head>
<body>
<%
Dim mm_xsl: Set mm_xsl = new MM_XSLTransform
mm_xsl.setXML "stuff.xml"
mm_xsl.setXSL "stuff.xsl"
mm_xsl.addParameter "uid", request.QueryString("uid")
Response.write mm_xsl.Transform()
%>
</body>
</html>
=========
theres obviously lots of records and this is simplified to just display
the jist of what i'm doing... which is trying to pull out all the row
elements from the XML file where the 3rd data element's value in a row
element is 20
if i call the page on an asp file with stuff.asp?uid=20
then:
parameter UID=<xsl:value-of select="$uid"/>
will output "parameter UID=20"
if i change:
<xsl:for-each select="row[data[3]/value=20]">
to
<xsl:for-each select="row[data[3]/value=$uid]">
then i get nothing returned from the for-each. with the hardcoded 20
though, it will output what it is supposed to. i assume my syntax for
including the param in the for-each wrong, but i can't figure out how
to fix it...
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl
<xsl:template match="/">
parameter UID=<xsl:value-of select="$uid"/>
<table border="1">
<tr>
<xsl:for-each select="row[data[3]/value=20]">
<td>
<xsl:value-of select="data[1]/value"/>
<xsl:value-of select="data[2]/value"/>
</td>
</xsl:for-each>
</tr></table>
</xsl:template></xsl:stylesheet>
stuff.XML:
<row>
<data>
<value>NAME</value>
</data>
<data>
<value>DATA</value>
</data>
<data>
<value>20</value>
</data>
stuff.asp:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include
file="includes/MM_XSLTransform/MM_XSLTransform.classVB.asp"
--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>XML</title>
</head>
<body>
<%
Dim mm_xsl: Set mm_xsl = new MM_XSLTransform
mm_xsl.setXML "stuff.xml"
mm_xsl.setXSL "stuff.xsl"
mm_xsl.addParameter "uid", request.QueryString("uid")
Response.write mm_xsl.Transform()
%>
</body>
</html>
=========
theres obviously lots of records and this is simplified to just display
the jist of what i'm doing... which is trying to pull out all the row
elements from the XML file where the 3rd data element's value in a row
element is 20
if i call the page on an asp file with stuff.asp?uid=20
then:
parameter UID=<xsl:value-of select="$uid"/>
will output "parameter UID=20"
if i change:
<xsl:for-each select="row[data[3]/value=20]">
to
<xsl:for-each select="row[data[3]/value=$uid]">
then i get nothing returned from the for-each. with the hardcoded 20
though, it will output what it is supposed to. i assume my syntax for
including the param in the for-each wrong, but i can't figure out how
to fix it...