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

RE: XSL Help!!

Subject: RE: XSL Help!!
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Fri, 6 Dec 2002 09:54:11 -0000
xsl variable name template
>    I have a couple of questions on XSL stylesheets. 
> 1)<xsl:template match="MEMBER">
>       <xsl:apply-templates select="NAME"/>
>       <xsl:apply-templates select="Phone[@type='work']"/> 
> </xsl:template>
> 
> When u say <xsl:apply-templates select="NAME"/>, Will all the 
> NAME nodes 
> under MEMBER be selected(say there are more than 1 NAME nodes under 
> MEMBER)?Also will the NAME template rule be applied to each 
> one of the NAME 
> nodes before the Phone node is selected?

yes, and yes.
> 
> 2)
> <xsl:variable name='signers' select=/legal_authenticator/person'/>
> 	<xsl:if test='$signers'>
> .....
> .....
> </xsl:if>
> 
> What is the xsl:if tag doing here? Is it testing whether 
> /legal_authenticator/person' exists??

Yes. The value of a variable is a node-set; when used as a test in an
xsl:if, it is converted to a boolean. An empty node-set is treated as
false, a non-empty node-set as true.
> 
> 3)<person_name>
>           <nm>
>             <GIV V="Henry"/>
>             <FAM V="Levin"/>
>            </nm>
>           <person_name.type_cd V="L" S="2d"/>
>         </person_name>
> 
> For the above xml, I see the following in the stylesheet 
> <xsl:apply-templates 
> select='person_name[person_name.type_cd/@V="L"]'/>
> What do the [] mean?? Why can't I just have / instead of the []??
> 

before you go any further, I think you need to get yourself a book or an
online reference for the language. Asking questions on this list is a
way to solve any problems you have, it's not the way to find out basic
facts about the language.

[] is a predicate: it filters a node-set according to a boolean
condition.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 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.