Selecting two attributes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tascien

    #1

    Selecting two attributes

    Can i do an xpth like this?

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

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

    T.
  • Rémi Peyronnet

    #2
    Re: Selecting two attributes

    > .//Field[@ID='Email' AND @Value='myeaml@ email.com']

    //Field[@ID='Email'][@Value='myeaml@ email.com']

    Should do it

    Hth

    --
    Rémi Peyronnet

    Comment

    • Keith Davies

      #3
      Re: Selecting two attributes

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

      off the top of my head:

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

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


      Keith
      --
      Keith Davies
      keith.davies@kj davies.org
      "Some do and some don't. I *hate* that kind of problem."
      "Understandable . Consistency is important with fuck ups."

      Comment

      • Robin Johnson

        #4
        Re: Selecting two attributes

        tascienu@ecoach es.com (Tascien) wrote in message news:<80e33136. 0408121343.4899 9212@posting.go ogle.com>...[color=blue]
        > Can i do an xpth like this?
        >
        > .//Field[@ID='Email' AND @Value='myeaml@ email.com'][/color]

        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

        Comment

        • Tascien

          #5
          Re: Selecting two attributes

          Thanks everyone...

          this drove me nuts yesterday...

          i guess this should work too:

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



          Keith Davies <kjdavies@kjdav ies.kjdavies.or g> wrote in message news:<slrncho0l k.311.kjdavies@ kjdavies.kjdavi es.org>...[color=blue]
          > On 2004-08-12, Tascien <tascienu@ecoac hes.com> wrote:[color=green]
          > > Can i do an xpth like this?
          > >
          > > .//Field[@ID='Email' AND @Value='myeaml@ email.com']
          > >
          > > what is the correct way? this one fails... I need to select a node
          > > that satisify both conditions...[/color]
          >
          > off the top of my head:
          >
          > .//Field[@ID='Email' and @Value='myeaml@ email.com']
          > .//Field[@ID='Email'][@Value='myeaml@ email.com']
          >
          > "and" is an operator. "AND" is not.
          >
          >
          > Keith[/color]

          Comment

          • Robin Johnson

            #6
            Re: Selecting two attributes

            On 13 Aug 2004 11:38:26 -0700, tascienu@ecoach es.com (Tascien) wrote:
            [color=blue]
            >Thanks everyone...
            >
            >this drove me nuts yesterday...
            >
            >i guess this should work too:
            >
            >.//Field[@ID='Email' or @Value='myeaml@ email.com'][/color]

            No. That'll select Field elements with ID attribute equl to "Email",
            OR with Value attribute equal to "myeaml@email.c om", OR with both.
            --
            Robin Johnson
            Lead Developer, enCircle Solutions Ltd.
            first initial last name at encircle dot co dot uk

            Comment

            Working...