I have a xml file which I need to retrieve the node "DocIDAutoNumerator" value but I only need to take it if the filed "ActivityTime" contains the date of today (2021-08-11) lets say and if the node "DocumentTypeValue" equals 1319. I was trying for hours but can mange to retrieve it with what I did. This is what I did -
XPath
//Document[.//Field[Code[text()='DocumentTypeValue'] and Value[text()='1319']] and //ActivityTime[contains(text(),'2021-08-11')] ]//Fields[Field[Code="DocumentTypeValue"]] /Field[Code="DocIDAutoNumerator"]/Value
XML
<root>
<Document>
<Labels>
<Label>
<Fields>
<Field>
<Code>DocumentTypeValue</Code>
<Value>4008</Value>
</Field>
<Field>
<Code>DocIDAutoNumerator</Code>
<Value>123121</Value>
</Field>
</Fields>
</Label>
</Labels>
<ActivityTime>2021-08-11 </ActivityTime>
</Document>
<Document>
<Labels>
<Label>
<Fields>
<Field>
<Code>DocumentTypeValue</Code>
<Value>1319</Value>
</Field>
<Field>
<Code>DocIDAutoNumerator</Code>
<Value>21321</Value>
</Field>
</Fields>
</Label>
</Labels>
<ActivityTime>1993-08-11 </ActivityTime>
</Document>
</root>