Selecting two attributes

Discussion in 'XML' started by Tascien, Aug 12, 2004.

  1. Tascien

    Tascien Guest

    Can i do an xpth like this?

    ..//Field[@ID='Email' AND @Value='']

    what is the correct way? this one fails... I need to select a node
    that satisify both conditions...

    T.
    Tascien, Aug 12, 2004
    #1
    1. Advertising

  2. > .//Field[@ID='Email' AND @Value='']

    //Field[@ID='Email'][@Value='']

    Should do it

    Hth

    --
    RĂ©mi Peyronnet
    =?ISO-8859-1?Q?R=E9mi_Peyronnet?=, Aug 12, 2004
    #2
    1. Advertising

  3. Tascien

    Keith Davies Guest

    On 2004-08-12, Tascien <> wrote:
    > Can i do an xpth like this?
    >
    > .//Field[@ID='Email' AND @Value='']
    >
    > what is the correct way? this one fails... I need to select a node
    > that satisify both conditions...


    off the top of my head:

    .//Field[@ID='Email' and @Value='']
    .//Field[@ID='Email'][@Value='']

    "and" is an operator. "AND" is not.


    Keith
    --
    Keith Davies

    "Some do and some don't. I *hate* that kind of problem."
    "Understandable. Consistency is important with **** ups."
    Keith Davies, Aug 13, 2004
    #3
  4. (Tascien) wrote in message news:<>...
    > Can i do an xpth like this?
    >
    > .//Field[@ID='Email' AND @Value='']


    Yes, you can, but the operator is and, not AND.
    --
    Robin Johnson
    Lead Developer, enCircle Solutions Ltd.
    first initial last name at encircle dot co dot uk
    Robin Johnson, Aug 13, 2004
    #4
  5. Tascien

    Tascien Guest

    Thanks everyone...

    this drove me nuts yesterday...

    i guess this should work too:

    ..//Field[@ID='Email' or @Value='']



    Keith Davies <> wrote in message news:<>...
    > On 2004-08-12, Tascien <> wrote:
    > > Can i do an xpth like this?
    > >
    > > .//Field[@ID='Email' AND @Value='']
    > >
    > > what is the correct way? this one fails... I need to select a node
    > > that satisify both conditions...

    >
    > off the top of my head:
    >
    > .//Field[@ID='Email' and @Value='']
    > .//Field[@ID='Email'][@Value='']
    >
    > "and" is an operator. "AND" is not.
    >
    >
    > Keith
    Tascien, Aug 13, 2004
    #5
  6. On 13 Aug 2004 11:38:26 -0700, (Tascien) wrote:

    >Thanks everyone...
    >
    >this drove me nuts yesterday...
    >
    >i guess this should work too:
    >
    >.//Field[@ID='Email' or @Value='']


    No. That'll select Field elements with ID attribute equl to "Email",
    OR with Value attribute equal to "", OR with both.
    --
    Robin Johnson
    Lead Developer, enCircle Solutions Ltd.
    first initial last name at encircle dot co dot uk
    Robin Johnson, Aug 15, 2004
    #6
    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. Yoav Shapira
    Replies:
    3
    Views:
    1,090
    Yoav Shapira
    Mar 8, 2006
  2. Jeffrey Barish
    Replies:
    0
    Views:
    279
    Jeffrey Barish
    Apr 19, 2004
  3. GenxLogic
    Replies:
    3
    Views:
    1,227
    andrewmcdonagh
    Dec 6, 2006
  4. Sharat  Koya
    Replies:
    1
    Views:
    381
    Martin Honnen
    Jul 27, 2007
  5. yawnmoth
    Replies:
    2
    Views:
    432
    yawnmoth
    Aug 18, 2008
Loading...

Share This Page