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

Re: how to match true and false and display yes and no

Subject: Re: how to match true and false and display yes and no instead?
From: JBryant@xxxxxxxxx
Date: Wed, 27 Jul 2005 12:27:11 -0500
index match
Well, if you actually tried to run these templates, your XML parser should 
spit out error messages.

You seem to be trying to use </xsl:apply-templates> to close 
<xsl:template>, which isn't XML.

Assuming you mean

<xsl:template match="members">
xsl-fo goes here.....
</xsl:template>

then you want

<xsl:template match="members">
xsl-fo goes here.....
<xsl:apply-templates/>
</xsl:template>

Otherwise, the processor gets to members and stops, never processing the 
children of members.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)




Christian Rasmussen <byggemandbob@xxxxxxxxx> 
07/27/2005 11:57 AM
Please respond to
xsl-list@xxxxxxxxxxxxxxxxxxxxxx


To
xsl-list@xxxxxxxxxxxxxxxxxxxxxx
cc

Subject
 how to match true and false and display yes and no instead?






Hi experts,

It seems to be a pretty simple question, but I'm newbie and I cannot
figure out how to do it :-(
please help me!

here is some sample xml showing my problem:

<members>
                 <profile>
                                 <name>Bill Clinton</name>
                                 <married>false</married>
                                 <kid>joe</kid>
                 </profile>
</members>


my xsl looks something like this:

<xsl:template match="members">
xsl-fo goes here.....
</xsl:apply-templates>

<xsl:template match="members/profile/married">
<xsl:if test=".='false'">no, he is not married</xsl:if>
<xsl:if test=".='true'">yes, he is married</xsl:if>
</xsl:apply-templates>

<xsl:template match="kid">
xsl-fo goes here.....
<xsl:apply-templates select="../married"></xsl:apply-templates>

I simply want to display "yes" and "no" instead of "true" and "false".
So I have made a template match which specifically matches the element
which holds the true or false value. After matching this element, I
test whether its true or false, and returns the text instead.

nothing shows up :-(

Thanx in advance for you help 
/Christian

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.