C
Corey
All,
I am relatively new to XML and I have what may sound like a dumb
question. I want to pass a query string variable to my xml document
and filter the output based on that variable. For example, if I type
in www.mysite.com?geid=0000123468 I want to display only
AccessReview/Report where GEID='0000123468'. I appreciate any help you
can provide.
Corey
Here is the code for my request.
---------------------------------------------------
XML file
---------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="AccessReview.xsl"?>
<Records>
<AccessReview>
<Report>Corey's Report</Report>
<GEID>0003620195</GEID>
</AccessReview>
<AccessReview>
<Report>Kim's Report #1</Report>
<GEID>0000123468</GEID>
</AccessReview>
<AccessReview>
<Report>Kim's Report #2</Report>
<GEID>0000123468</GEID>
</AccessReview>
<AccessReview>
<Report>Kim's Report #3</Report>
<GEID>0000123468</GEID>
</AccessReview>
<AccessReview>
<Report>Ron's Report #1</Report>
<GEID>0000204138</GEID>
</AccessReview>
<AccessReview>
<Report>Ron's Report #2</Report>
<GEID>0000204138</GEID>
</AccessReview>
<AccessReview>
<Report>Ron's Report #3</Report>
<GEID>0000204138</GEID>
</AccessReview>
<AccessReview>
<Report>Ron's Report #4</Report>
<GEID>0000204138</GEID>
</AccessReview>
</Records>
---------------------------------------------------
XSL file
---------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head><title>Access Review</title>
</head>
<body>
<pre>
<xsl:for-each select="Records/AccessReview[GEID=variableName]">
<xsl:value-of select="Report"/>
</xsl:for-each>
</pre>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I am relatively new to XML and I have what may sound like a dumb
question. I want to pass a query string variable to my xml document
and filter the output based on that variable. For example, if I type
in www.mysite.com?geid=0000123468 I want to display only
AccessReview/Report where GEID='0000123468'. I appreciate any help you
can provide.
Corey
Here is the code for my request.
---------------------------------------------------
XML file
---------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="AccessReview.xsl"?>
<Records>
<AccessReview>
<Report>Corey's Report</Report>
<GEID>0003620195</GEID>
</AccessReview>
<AccessReview>
<Report>Kim's Report #1</Report>
<GEID>0000123468</GEID>
</AccessReview>
<AccessReview>
<Report>Kim's Report #2</Report>
<GEID>0000123468</GEID>
</AccessReview>
<AccessReview>
<Report>Kim's Report #3</Report>
<GEID>0000123468</GEID>
</AccessReview>
<AccessReview>
<Report>Ron's Report #1</Report>
<GEID>0000204138</GEID>
</AccessReview>
<AccessReview>
<Report>Ron's Report #2</Report>
<GEID>0000204138</GEID>
</AccessReview>
<AccessReview>
<Report>Ron's Report #3</Report>
<GEID>0000204138</GEID>
</AccessReview>
<AccessReview>
<Report>Ron's Report #4</Report>
<GEID>0000204138</GEID>
</AccessReview>
</Records>
---------------------------------------------------
XSL file
---------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head><title>Access Review</title>
</head>
<body>
<pre>
<xsl:for-each select="Records/AccessReview[GEID=variableName]">
<xsl:value-of select="Report"/>
</xsl:for-each>
</pre>
</body>
</html>
</xsl:template>
</xsl:stylesheet>