XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
John DhomSubject: XML/XSLT Design Question
Author: John Dhom
Date: 09 Jul 2001 06:53 PM
Simple Problem?
I need to create a system that will take an XML document with user/orderS/lineItems and generate an Invoice with a fixed number of lineItems... let's say 10.

An order can contain more than 10 lineItems, in which case I need the whole invoice template repeated as a 2nd page with the next 10 lineItems and so on.

XML is my data from DB
XSL is my Invoice template + XSLT

Is there a way to construct a XSL that given 1 user, 1 order, 30 lineItems... it will return 3 instances of the Invoice template each with 10 lines?

I guess I could preprocess the recordset and call the XSLT for each 10 lineItems... but that feels wrong to me.

Thanks.
/jhd

Posttop
Vittorio ViarengoSubject: XML/XSLT Design Question
Author: Vittorio Viarengo
Date: 09 Jul 2001 11:38 PM
John,

I did something similar on my web site.
I have an XML database of pictures when the users runs a query the site display 4 pictures per screen.

The way I did it was by using parametrized XSLT stylesheets.

I created an XSL style sheet that displays the information about the first 4 pictures as well as a link that calls the same XSL template with the same XPath query but passing an additional parameter which is the current position inside the query (like a cursor).

I use this parameter to start the loop through the pictures, something like this:

{xsl:for-each select="$qry[position()>= $the_start and position() < $the_start + $the_delta]"}

Where $qry is the xpath query, $the_start is the current position and $the_delta defines how many items I'm displaying in each screen.
I'm using eXcelon Extensible Information Server as my XML repository and XSLT processor.

You can see how it works and check the URLs and how I use XSLT parameters at

http://www.viarengo.com (click on any picture roll and then check the URL behind the next button)
(you may have to switch to English by selecting the "Language/English" menu)

I hope this helps

Ciao

Vittorio

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.