|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] pass a parameter from the URL using Javascript
Hi,
Does anyone know how to pass a parameter from the URL? I declare my parameter at the top of the xsl stylesheet, like that: <xsl:param name="page_number" select=" 1 "/> iI change the select value and i get the h2 that i want. My xml file looks like that: <div class="section"> <h2>Chris</h2> <p>text</p> <p>text</p> </div> <div class="section"> <h2> <a href="http://www.mypage.com">Leo</a> </h2> </div> <div class="section"> <h2>George</h2> <p>text</p> </div> <div class="section"> <h2>Alex</h2> <p>text</p> <p>text</p> </div> In my xsl i have this template witch i pick-up the desired h2 each time: <xsl:template match="//xhtml:div[@class='section'][position()=$page_number]/xhtml:h2/*"> <xsl:when test="//xhtml:div[@class='section'][position()=$page_number]"> </xsl:template> I found something like: <script> var page_number = location.search.substr(1).split("?"); </script> but no luck... Cheers Leo _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








