Page 1 of 1

Create Private Data from XML Log

Posted: Tue Jan 20, 2026 5:11 pm
by jwhitton
I am creating Private Data from XML Log [Metadata.Text:Dataset="Log",Model="XML",Path="/root/textFields/textField[26]/fieldContent"]

Today the field changed from textField[26] to textField[25]. This is coming from a edocumentation.pdf from our postal software. When I put in root/textFields/textField[tag='psTotalPieces_7DM0L0Z6Y']/fieldContent I get an invalid path. I am missing anything?

Thanks
Joe

Re: Create Private Data from XML Log

Posted: Tue Jan 20, 2026 6:28 pm
by jchristofi
We found the answer, but for anyone else looking, here is is the solution.
[Metadata.Text:Dataset="Log",Model="XML",Path="/root/textFields/textField[contains(@fieldName,'psTotalPieces')]/fieldContent"]

The key change is in the predicate portion:

Before: [@fieldName='psTotalPieces_7DM0L0Z6Y']
After: [contains(@fieldName,'psTotalPieces')]

This will match any textField element where the @fieldName attribute contains the substring 'psTotalPieces', regardless of what comes before or after it.
Other usable XPath functions:
starts-with
ends-with

Re: Create Private Data from XML Log

Posted: Tue Feb 10, 2026 2:43 pm
by PorterButler
This method is more stable than using index [25] or [26], which are easily changed when the provider adjusts the PDF/XML structure.