Subject: Re: [xsl] sub element selection From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx> Date: Tue, 16 Apr 2002 12:18:37 -0600 |
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/>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] sub element selection, Jeni Tennison | Thread | [xsl] pass HttpServletRequest from , Ming |
Re: [xsl] further question regardin, Joerg Heinicke | Date | [xsl] pass HttpServletRequest from , Ming |
Month |