[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to display XML data partially
Hi Davut, > I am generating the page dynamically. More clearly I wanted to > define an xsl parameter startNode pointing to the first of a 10 > device block. Then incremet it by 10 everytime a user clicks a > "Next" button or hyperlink. > > However I was not able to increment the parameter. You need to pass the new value of the parameter into the stylesheet. How you do that depends on the processor that you're using to process the stylesheet - I guess you're either doing a client-side transform with MSXML or a server-side transform with Cocoon. If you're doing the transform with Cocoon, then you can pass parameters using the URL that you have with the link. So the URL: devices.xml?startNode=1 will set the $startNode parameter to 1. So if you're using Cocoon it's just a matter of generating this URL dynamically with an attribute value template: <a href="devices.xml?startNode={$startNode + 10}">Next</a> If you're doing the transform with MSXML, then to use parameters you need a script that manages the transform - takes the data, takes the stylesheet, creates DOMs and XSLTemplate objects and so on. Have a look at the MSXML SDK (loop up setParameter) for details. Then it's a matter of creating the Javascript on the output page that you're generating, i.e. create the script element: <script type="text/javascript"> function loadNextPage(index) { ... processor.setParameter('startNode', index); ... } </script> Then later on create the a element that, when clicked, calls this function. You can use an attribute value template within the 'onclick' attribute to identify the index that should be passed to the function: <a onclick="loadNextPage({$startNode + 10})">Next</a> I hope that helps, 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
|