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

Re: How to test on more than one axis

Subject: Re: How to test on more than one axis
From: "Aleksei Valikov" <valikov@xxxxxx>
Date: Mon, 3 Sep 2001 19:40:31 +0200
more than one axis is
Hi.

> My XML document has a number of 'mandatory' elements, identified as such
by
> an attribute, for example:
>
> <Person>
> <FirstName>David</FirstName>
> <LastName Mandatory="True">Baldwin<LastName>
> </Person>
>
> I want to be able to tell if the document is valid in the sense that all
of
> the 'mandatory' elements in the document contain a value.
> Is this a syntax issue, or am I trying to do something the wrong way in
xsl?
> At the end of the day I am just trying to check the xml contains the
> required elements, and I have control of the xml schema, so maybe there is
a
> better way of approaching this. Any ideas?

//*[@Mandatory='True'][not(text())]

will return set of elements which have Mandatory attribute set to True and
content which is an ampty string.
in other words

<xsl:if test="//*[@Mandatory='True'][not(text())]">
  <xsl:text>Some of mandatory elements are empty</xsl:text>
</xsl:if>

Hope I'm not mistaken.

Bye.
/lexi


 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.