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

Re: sub element selection

Subject: Re: sub element selection
From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx>
Date: Tue, 16 Apr 2002 12:18:37 -0600
snip attribute
At 11:16 AM 4/16/2002, Jeni wrote:
Hi Pete,

you can just use . to mean "the value of the current node":

[snip example]

you could use xsl:choose instead:

[snip alternate]

The easiest way to get hold of that is to go up to the Communication element and then down again to the CommunicationNumber element:
This gives:


[snip merged example]

In this case it makes more sense to me to match the Communication elements and refer to the CommunicationType and CommunicationNumber children as follows:

[snip another alternate]

And since you're doing roughly the same for each of them, I'd be
tempted to put the xsl:choose within the xsl:with-param rather than
having two separate calls, although on the other hand this does assume
that the CommunicationType is either 'DAYPHONE' or 'EMAIL', which
might not be a valid assumption:

[snip single all-encompassing template]

In your 'makeProperty' template, it would also probably be simpler if
you used attribute value templates rather than xsl:attribute:

[snip attribute example]

Or of course you could do the whole thing in one template if you
wanted:

[snip tiny template]

In XSLT 2.0, even simpler:

[snip smallest yet]

Jeni

Or you can just use XSLT 4.2 and type: <b9/>

Goodness Jeni, never let it be said that you give half-assed answers. We all appreciate it. :)


Greg Faron




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.