Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Location
    Elizabeth City, NC
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Xpath "OR" Question

    I have these two working Xpath queries:

    Code:
    Competency/CompetencyAttributeList/CompetencyAttribute[Name='ASSET_TYPE_VALUE']/Value
    
    Competency/CompetencyAttributeList[not(CompetencyAttribute/Name='ASSET_TYPE_VALUE')]//parent::*/Code
    I'm certain it's possible to merge them into a single statement using an "OR", but I am unsure what the proper syntax for this should be. The following doesn't work:

    Code:
    (Competency/CompetencyAttributeList/CompetencyAttribute[Name='ASSET_TYPE_VALUE']/Value) or (Competency/CompetencyAttributeList[not(CompetencyAttribute/Name='ASSET_TYPE_VALUE')]//parent::*/Code)
    Neither does some variations on this that I've tried. I just started working with Xpath last week, and am floored with how comprehensive it is. Thanks in advance for any assistance anyone can provide.

  • #2
    New to the CF scene
    Join Date
    Mar 2009
    Location
    Elizabeth City, NC
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Solved it!

    Took me forever to figure it out, but here's the solution for anyone who's interested. It works fantastically:

    Code:
    Competency/CompetencyAttributeList/CompetencyAttribute[Name='ASSET_TYPE_VALUE']/Value|//Competency/CompetencyAttributeList[not(CompetencyAttribute/Name='ASSET_TYPE_VALUE')]//parent::*/Code
    The solution was simply to join the two separate queries with "|//" between them. XPATH RULES!!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •