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

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

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. Markus
    Replies:
    1
    Views:
    1,935
    Markus
    Nov 23, 2005
  2. Thomas Marti
    Replies:
    1
    Views:
    1,333
    Jesper Zedlitz
    Nov 25, 2003
  3. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,572
    Stanimir Stamenkov
    Apr 25, 2005
  4. johnny
    Replies:
    5
    Views:
    955
    johnny
    Dec 10, 2006
  5. Replies:
    3
    Views:
    1,845
    Brandon McCombs
    May 2, 2007
  6. John B. Matthews
    Replies:
    4
    Views:
    937
    John B. Matthews
    Sep 12, 2008
  7. Roedy Green
    Replies:
    3
    Views:
    835
  8. Tomasz Chmielewski

    [CSS] how can I show spaces as spaces?

    Tomasz Chmielewski, Sep 5, 2009, in forum: HTML
    Replies:
    21
    Views:
    2,072
    Jan C. Faerber
    Sep 10, 2009
Loading...