This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How to display XML data partially
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] How to display XML data partially
- From: Davut Karabay <dkarabay at yahoo dot com>
- Date: Wed, 21 Mar 2001 21:45:50 -0800 (PST)
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Jeni,
First of all, thanks for all the effort you put in
answering questions.
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.
This is something similar to what you were saying
>>pass the stylesheet the index of
>> the first device to occur on the page
Can you suggest me anything on how to increment the
parameter after clicking "Next"? I believe If I am
able to increment startNode then I could use the
sibling idea you have suggested to get the next 9
devices.
Best Regards,
Davut
--- Jeni Tennison <mail@jenitennison.com> wrote:
> Hi Davut,
>
> > I want to display those devices in an HTML page
> BUT 10 DEVICES AT A
> > TIME.
>
> The first issue is how you are generating the HTML
> pages. There are
> two ways that you could do it:
>
> * create the pages dynamically - pass the
> stylesheet the index of
> the first device to occur on the page, and get
> it to create the
> HTML page for the 10 devices starting from that
> one
>
> * create the pages statically - create all the
> pages in one big
> transform, with each page holding 10 devices
>
> I don't know which method you're using (dynamic
> transformation on
> request or static/batch transformation). But
> whichever you use,
> you'll probably want to apply templates to only the
> first device to
> appear on a particular page, and then have a
> template that does
> something with that device and the next 9.
>
> Given a device element as the current node, you can
> get the 10 devices
> starting from that one with:
>
> . | following-sibling::device[position() < 10]
>
> In other words, make a node set that consists of
> this node (.) and the
> following sibling device elements whose position
> (within the list of
> following sibling device elements) is less than 10.
>
> So the template for a device should probably look
> something like:
>
> <!-- only applied to the first device in a page -->
> <xsl:template match="device">
> <xsl:for-each select=". |
> following-sibling::device
> [position() <
> 10]">
> <!-- whatever output you want for the devices
> -->
> </xsl:for-each>
> </xsl:template>
>
> Then it comes down to how you choose the device to
> apply templates to,
> which depends on how you're generating the page.
>
> I hope that helps,
>
> Jeni
>
> ---
> Jeni Tennison
> http://www.jenitennison.com/
>
>
>
> XSL-List info and archive:
> http://www.mulberrytech.com/xsl/xsl-list
>
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list