Using XPATH to get a a specific node

Hi,
I got an xml file that I need to work on (adding it in the end of the post).
I need the retrieve the node “DocIDAutoNumerator” only when I find the node “DocumentTypeValue” = 1319.
Is there a way to look it in just one XPATH?
or should I look for DocumentTypeValue ==1319 and get the current position so I can make a XPATH using the location I just retrieved?
Thank you all for your help!

the file is -

        <Document>
           <Labels>
              <Label>
                 <Fields>
                    <Field>
                       <Code>DocumentTypeValue</Code>
                       <Value>4008</Value>
                    </Field>
                    <Field>
                       <Code>DocIDAutoNumerator</Code>
                       <Value>123121</Value>
                    </Field>
                 </Fields>
              </Label>
           </Labels>
        </Document>

        <Document>
           <Labels>
              <Label>
                 <Fields>
                    <Field>
                       <Code>DocumentTypeValue</Code>
                       <Value>1319</Value>
                    </Field>
                    <Field>
                       <Code>DocIDAutoNumerator</Code>
                       <Value>21321</Value>
                    </Field>
                 </Fields>
              </Label>
           </Labels>
        </Document>

Hey,
I hope this workflow will be helpful for you:
communityXPATH.zip (2.9 KB)

HI,
Thank you for your quick reply!
I managed to find the XPATH which made the best result -

//Fields[Field[Code="DocumentTypeValue"][Value="1319"]]
 /Field[Code="DocIDAutoNumerator"]/Value

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.