Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 4th, 2013, 03:58 AM
Registered User
Points: 20, Level: 1
Points: 20, Level: 1 Points: 20, Level: 1 Points: 20, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help required to plot seat map using xml and xslt

I have the following xml value which gives the primary information of seat map

<row noOfRows="72">
<column ctype="ST" cname="A"/>
<column ctype="ST" cname="B"/>
<column ctype="ST" cname="C"/>
<column ctype="AL"/>
<column ctype="ST" cname="D"/>
<column ctype="ST" cname="E"/>
<column ctype="ST" cname="F"/>
<column ctype="ST" cname="G"/>
<column ctype="AL"/>
<column ctype="ST" cname="H"/>
<column ctype="ST" cname="J"/>
<column ctype="ST" cname="K"/>
</row>

the node <row noOfRows="50"> is the information to create 50 rows and each column(ex:A,B,C,etc) should have 50 columns.


ex:
A [] [] [] [] [] ...... till 50
B [] [] [] [] [] ...... till 50
C [] [] [] [] [] ...... till 50
<column ctype="AL"/>
D [] [] [] [] [] ...... till 50
E [] [] [] [] [] ...... till 50
F [] [] [] [] [] ...... till 50
G [] [] [] [] [] ...... till 50
<column ctype="AL"/>
H [] [] [] [] [] ...... till 50
J [] [] [] [] [] ...... till 50
K [] [] [] [] [] ...... till 50

please help me to plot this information using XSLT
Reply With Quote
  #2 (permalink)  
Old August 4th, 2013, 08:43 AM
mhkay's Avatar
Wrox Author
Points: 18,438, Level: 59
Points: 18,438, Level: 59 Points: 18,438, Level: 59 Points: 18,438, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,954
Thanks: 0
Thanked 290 Times in 285 Posts
Default

You haven't given enough information to provide concrete code, but in XSLT 2.0 you can do

Code:
<xsl:for-each select="1 to $N">
   ....
</xsl:for-each>
In XSLT 1.0 the usual trick for doing this is

Code:
<xsl:for-each select="(//node())[position &lt;= $N]">
  ....
</xsl:for-each>
which works so long as there are at least $N nodes in your input document.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Site Map XML File BILL22 Visual Studio 2005 2 September 9th, 2011 04:55 AM
XLST noob - XML -> XML transform help required Crass1968 XSLT 6 March 4th, 2010 07:32 AM
XSLT 2.0 array/map geek.shrek XSLT 5 November 2nd, 2007 10:20 AM
XSLT for complicated xml to xml transf. required doug@sirvisetti XSLT 3 June 17th, 2005 04:26 PM
AIRPLANE SEAT CHART..... PLEASE HELP Raineri33 C++ Programming 4 September 8th, 2003 11:18 PM



All times are GMT -4. The time now is 04:03 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.