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

RE: test if attribute contains value and proceed

Subject: RE: test if attribute contains value and proceed
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 25 Sep 2002 12:49:23 +0100
xsl if attribute
> Hello I need to test if any of the 
> /investitionen/massnahme/@datum has a 
> value in it. if EVERY @datum is filled with an value, 
> proceed.

In other words, if there is some @datum that is equal to "", don't
proceed.

<xsl:if test="not(/investitionen/massnahme/@datum = '')">
  proceed
</xsl:if>

The = family of operators in XSLT (including !=) return true if some
item on the left compares (=, != etc) to some item on the right.

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

 Something like:
> 
> <xsl:if test="/investitionen/massnahme/@datum">
> <fo:block>everything is ok!</fo:block>
> </xsl:if>
> 
> what do I not understand with my newbie brain?
> 
> 
> <investitionen>
>   <massnahme datum="Dezember 2002">
>    <produkte>
>     <produkt id="1"/>
>    </produkte>
>   </massnahme>
>   <massnahme datum="Juni 2005">
>    <produkte>
>     <produkt id="3"/>
>    </produkte>
>   </massnahme>
>   <massnahme datum="Juni 2006">
>    <produkte>
>     <produkt id="4"/>
>    </produkte>
>   </massnahme>
> </investitionen>
> =OK
> 
> <investitionen>
>   <massnahme datum="Dezember 2002">
>    <produkte>
>     <produkt id="1"/>
>    </produkte>
>   </massnahme>
>   <massnahme datum="">
>    <produkte>
>     <produkt id="3"/>
>    </produkte>
>   </massnahme>
>   <massnahme datum="Juni 2006">
>    <produkte>
>     <produkt id="4"/>
>    </produkte>
>   </massnahme>
> </investitionen>
> =NOT OK
> 
> <investitionen>
>   <massnahme datum="">
>    <produkte>
>     <produkt id="1"/>
>    </produkte>
>   </massnahme>
>   <massnahme datum="">
>    <produkte>
>     <produkt id="3"/>
>    </produkte>
>   </massnahme>
>   <massnahme datum="">
>    <produkte>
>     <produkt id="4"/>
>    </produkte>
>   </massnahme>
> </investitionen>
> =NOT OK
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.