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

Re: problem with xsl:choose

Subject: Re: problem with xsl:choose
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 25 May 2001 11:33:13 +0100
Re:  problem with xsl:choose

It would be very helpful if you gave an example of the output that
you're after.  But without that, I think that you want to have table
elements with a class of 'screen' for each screen element, and table
elements with a class of 'table' for each table element.  You can do
that with separate templates for the two types:

<xsl:template match="screen">
   <table class="screen" tID="{@h}">
      <xsl:call-template name="screenHdr" />

<xsl:template match="table">
   <table class="table" tID="{@h}">
      <xsl:call-template name="tableHdr" />

Applying templates to nodes is a good way of managing this because it
doesn't do anything unless the nodes exist in the first place.  If you
want to output something if they're not available, then you can add an
xsl:if that tests for it and emits an error as appropriate.

<xsl:template match="/">
   <xsl:apply-templates select="data/screen" />
   <xsl:apply-templates select="data/table" />
   <xsl:if test="not(data/screen or data/table)">

I hope that helps,


Jeni Tennison

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

Current Thread


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.
First Name
Last Name
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.