Jump to content

XPATH trying to figure out segments any help appreciated.


Recommended Posts

Hello everyone, 

Using the example here https://www.autoitscript.com/forum/topic/160865-how-to-retrieve-all-xpaths-from-an-xml-file/

How would one get from 

\Filter\CustomClasses\MapGroup\Color
\Filter\CustomClasses\MapGroup\Color[@name=groupped_colormapcontrol_01]
\Filter\CustomClasses\MapGroup\Color[@display_name=Foreground]
\Filter\CustomClasses\MapGroup\Color[@hdr=false]
\Filter\CustomClasses\MapGroup\Color[@required=false]
\Filter\CustomClasses\MapGroup\Color
\Filter\CustomClasses\MapGroup\Color[@name=groupped_colormapcontrol_02]
\Filter\CustomClasses\MapGroup\Color[@display_name=Background]
\Filter\CustomClasses\MapGroup\Color[@hdr=true]
\Filter\CustomClasses\MapGroup\Color[@required=false]

to this

\Filter\CustomClasses\MapGroup[1]\Color
\Filter\CustomClasses\MapGroup[1]\Color[@name=groupped_colormapcontrol_01]
\Filter\CustomClasses\MapGroup[1]\Color[@display_name=Foreground]
\Filter\CustomClasses\MapGroup[1]\Color[@hdr=false]
\Filter\CustomClasses\MapGroup[1]\Color[@required=false]
\Filter\CustomClasses\MapGroup[1]\Color[2]
\Filter\CustomClasses\MapGroup[1]\Color[2][@name=groupped_colormapcontrol_02]
\Filter\CustomClasses\MapGroup[1]\Color[2][@display_name=Background]
\Filter\CustomClasses\MapGroup[1]\Color[2][@hdr=true]
\Filter\CustomClasses\MapGroup[1]\Color[2][@required=false]

I am currently using the last code on the linked URL it's 7 years old but does the job I'm just trying to figure out how to get the segments so I can use the xpath output to get a value of a section but only knowing the segment numbers.

If there is a page already documented about this I apologize in advance I've search like crazy with no successful results.

Shawn 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...