[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Q on <xsl:templates>

Subject: Q on <xsl:templates>
From: "Walter Torres" <walter@xxxxxxxxx>
Date: Wed, 31 Jan 2001 13:19:58 -0600
change xsl display order
I am reading Michael Kays Book (XSLT Pro Ref) and learning alot!

On page 71 there is a demo stylesheet that shows how to create an HTML Table
for the books.xml on page 70.

My question is this... from what I see, it looks like the order of cell
display is determined by the data order.

I understand that if I explicitly define each cell/NODE I can determine what
order this data is to be displayed, but this defeats the nice recursion
going on here (ie: page 73).

What I am trying to do is create a method that inwhich another XML structure
can determine the display order of this books.xml.

For example, I create a <titles> block (see below) that I want to use to
determine the display order on the fly. So if I want to change this order, I
simply change this <titles> blcok and not the XSLT code.

( I added <pubdate> to the books.xml data )

I have read chatper 8:Design Patterns, but I saw nothing I could derive a
solution to fit what I am looking for.

can someone show my a few pointer, sources, urls, pages numbers on how I
might go about solving this?

Thanks

Walter


============================

This block should do 3 things:
  1) determine the NODE display order
  2) Be used as column titles in the table display
  3) Set the column width for its respective cell


<books>
 <titles>
  <header id='title'   colWidth='180'>Title</header>
  <header id='author'  colWidth='080'>Author</header>
  <header id='price'   colWidth='050'>Price</header>
  <header id='pubdate' colWidth='*'  >Published</header>
  <header id='pages'   colWidth='040'>Pages</header>
  <header id='binding' colWidth='120'>Binding</header>
 </titles>

... original data goes here...

</books>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.