Reject an attribute that has only spaces in schema

Discussion in 'XML' started by hellostephen@hotmail.com, May 18, 2005.

  1. Guest

    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.
    , May 18, 2005
    #1
    1. Advertising

  2. Peter Flynn Guest

    wrote:

    > 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.


    <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.

    > BTW I know very little regular expression syntax.


    Not needed in this case.

    ///Peter
    --
    sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
    &;top"
    Peter Flynn, May 27, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    345
  2. Boris Pelakh
    Replies:
    1
    Views:
    760
    VisionSet
    Nov 14, 2004
  3. Markus
    Replies:
    1
    Views:
    1,528
    Markus
    Nov 23, 2005
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,250
    Stanimir Stamenkov
    Apr 25, 2005
  5. Bob Wheeler
    Replies:
    0
    Views:
    371
    Bob Wheeler
    Jun 30, 2003
Loading...

Share This Page