Enzo Marinelli Posted January 28, 2004 Share Posted January 28, 2004 I have an ASP.NET page (news.aspx), which reads from a XML file (bd.xml) with this code: <asp:Xml id="Xml2" runat="server" DocumentSource="/news/bd.xml" TransformSource="/news/stylesheet.xsl"> I want the XSL file (stylesheet.xsl) to read from the url parameter (http://***/pages/news.aspx#2) and only display the XML record with id attribute = 2 I hope you can understand my bad english... What I mean is, my XML looks something like this: <BD> <newsArticle id="1" date="01/01/2004" icon="images/navbuttons/b01.gif"> <newsArticle id="2" date="01/02/2004" icon="images/navbuttons/b02.gif"> <newsArticle id="3" date="01/03/2004" icon="images/navbuttons/b03.gif"> <newsArticle id="4" date="01/04/2004" icon="images/navbuttons/b04.gif"> </BD> I know that for that I would have in my XSL file the next portion of code: <xsl:if test="@id = SOMETHING"> But I don't know how to read the #2 portion of the URL address... Thank you in advance. Link to comment https://www.neowin.net/forum/topic/136174-xsl-reading-url-parameters/ Share on other sites More sharing options...
Question
Enzo Marinelli
I have an ASP.NET page (news.aspx), which reads from a XML file (bd.xml) with this code:
<asp:Xml id="Xml2" runat="server" DocumentSource="/news/bd.xml" TransformSource="/news/stylesheet.xsl">
I want the XSL file (stylesheet.xsl) to read from the url parameter (http://***/pages/news.aspx#2) and only display the XML record with id attribute = 2
I hope you can understand my bad english...
What I mean is, my XML looks something like this:
<BD>
<newsArticle id="1" date="01/01/2004" icon="images/navbuttons/b01.gif">
<newsArticle id="2" date="01/02/2004" icon="images/navbuttons/b02.gif">
<newsArticle id="3" date="01/03/2004" icon="images/navbuttons/b03.gif">
<newsArticle id="4" date="01/04/2004" icon="images/navbuttons/b04.gif">
</BD>
I know that for that I would have in my XSL file the next portion of code:
<xsl:if test="@id = SOMETHING">
But I don't know how to read the #2 portion of the URL address...
Thank you in advance.
Link to comment
https://www.neowin.net/forum/topic/136174-xsl-reading-url-parameters/Share on other sites
0 answers to this question
Recommended Posts