[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL navigation
Hi Varada, > At a time i want to display only five records from xml file and and > on click event i would like to go for next 5 records. > > For this i need to access a hidden html element in an xsl. Is it > possible? and i want to use a xsl:value of to pass a parameters to > javascript called on 'onClick' event of a html button object. Is it > possible? I can think of two main ways that you could do this. The first involves a single transformation that generates an HTML file that contains all the rows, but uses CSS to keep some of the rows hidden. When you click on the button, you can use JavaScript (or something) to change the style of the rows so that different ones show or are hidden. This should be quite easy to do, although may have different results in different browsers because of variable CSS support. If you want to pursue this solution, you should create working HTML first, and then work out how to generate that HTML from your stylesheet -- you can generate onclick attributes and script content in just the same way as you can any other attributes or content, XSLT doesn't know the difference. The second method involves doing several transformations, each giving different portions of the XML based on a parameter passed to the stylesheet. To do this, you need to make sure that your stylesheet accepts a parameter that can determine which rows to display from the source XML. Then it depends on whether you're doing a client-side or server-side transformation. With a client-side transformation, you need to write a JavaScript (or something) script to perform the transformation using that stylesheet, with a function that passes a parameter into the stylesheet (using the .addParameter method). You need to reference that script in the HTML document that you create from your stylesheet, and include the relevant JavaScript for calling your function within the HTML that you generate. With a server-side transformation, you need to make sure that the servlet that you're using is configured correctly, so that it can pass parameters through to the stylesheet, and then adjust the links in the HTML generated by your stylesheet so that the correct parameter is passed through each time. Either way, the issue is not so much in the XSLT stylesheet itself but rather how you activate the stylesheet. If you need more detail on any of the methods, let us know. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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
|