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

Re: easy one

Subject: Re: easy one
From: Gary Hegenbart <ghegenbart@xxxxxxxxx>
Date: Fri, 22 Oct 2004 11:47:14 -0700
gary hegenbart
Hardy,
I'm not an expert, but you need to check to see if the node name
starts with ERR. Assuming you are working in the 'user' node, you can
try this:

<xsl:if test="count(./*[starts-with(name(), 'ERR')])&gt;0">
  <!-- do something for an error node -->
</xsl:if>

It counts all child nodes whose name starts with ERR, the tests if the
count is greater than

Good luck,
Gary

On Fri, 22 Oct 2004 14:28:15 -0400, Hardy Merrill
<hmerrill@xxxxxxxxxxxxxxxx> wrote:
> I think this is probably easy for someone more knowledgeable than I am
> in XSL - I have an XML document something like this:
> 
> <user>
>     <name>Joe J# Jones</name>
>     <phone>123-456-7890</phone>
>     <ERR_name>Name may not contain invalid characters</ERR_name>
> </user>
> 
> I'm working with one "user" here.  For the user, in an "if test" I want
> to know if there are any node names within that "user" that start with
> "ERR_" - how can I do that??
> 
> <xsl:if test="count(user[starts-with("ERR_
> 
> I can't seem to find the answer.  Anyone know this off the top of their
> head?
> 
> TIA.
> 
> Hardy Merrill
> 
> 


-- 
Gary Hegenbart

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.