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

RE: xsl:choose and xsl:when

Subject: RE: xsl:choose and xsl:when
From: christoph.naber@xxxxxxxxxxxxxxxxxxx
Date: Wed, 29 Aug 2007 08:08:54 +0200
RE:  xsl:choose and xsl:when
Maybe you'll be fine with

test="PHONE[not(@TYPE)]"

Greetings Christoph

oryann9@xxxxxxxxx schrieb am 29.08.2007 00:43:43:

>
> Hello all,
>
> Still new to xsl and xml, but I am getting stuck on
> one of my online class lessons from oreilly. I need to
> use another xsl:when to output (HOME) when the TYPE
> attribute is empty.
>
> Here is what I have thus far:
> Was not sure what it means to be empty in xsl, but I
> have used <xsl:when test="(PHONE/@TYPE='')"> and other
> similar trys with no luck.
>
> please help
> thx!
>
> __CODE__
>
> <?xml version="1.0" ?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="html"/>
> <xsl:template match="/">
>      <HTML>
>      <HEAD>
>      <TITLE>My Phone Book</TITLE>
>      </HEAD>
>      <BODY BGCOLOR="BLACK">
>           <xsl:apply-templates select="//LISTING" />
>      </BODY>
>      </HTML>
> </xsl:template>
> <xsl:template match="LISTING">
>      <FONT COLOR="WHITE"><xsl:value-of
> select="LAST"/>,
>           <xsl:value-of select="FIRST"/></FONT>
>      <FONT COLOR="orange" SIZE="+2"><xsl:value-of
> select="PHONE"/>
> <xsl:choose>
>       <xsl:when test="boolean(PHONE/@TYPE)">
>            (<xsl:value-of select="PHONE/@TYPE" />)
>       </xsl:when>
>        <xsl:when test="(PHONE/@TYPE='')">
>             (HOME)
>       </xsl:when>
>       <xsl:otherwise>
>            (HOME)
>       </xsl:otherwise>
> </xsl:choose>
>      </FONT>
> </xsl:template>
> </xsl:stylesheet>
>
>
>
>
_____________________________________________________________________________
_______
> Moody friends. Drama queens. Your life? Nope! - their life, your
> story. Play Sims Stories at Yahoo! Games.
> http://sims.yahoo.com/
>



If you are not the intended addressee, please inform us immediately that you
have received this e-mail by mistake and delete it. We thank you for your
support.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.