Page 1 of 1

How to define an unique XML-Path

Posted: Wed May 17, 2017 11:30 am
by pfischer
Hi everybody,

I have a small flow, where the user have to fill out 7 fields with metadata-information (via "Submission point" configurator) in switch client (e.g. document-author of a PDF). This metadata of the PDF is updated with the "Inject XMP" configurator. The updated metadata entries are generated with a "Single-line text with variables" and these variable contains an XML-Path like this:
[Metadata.Text:Path="/field-list/field[7]/value",Dataset="Submit",Model="XML"]

Everything works correct so far.

But if I add a new metadata field at the beginning of my list in the "Submission point" configurator, all following entries get a new number in the field-list. E.g. in my list the former field[1] will get field[2], the former field[3] gets field[4] and so on. So I have to update all XML-path-entries in my complete flow.

How is it possible to set a unique XML-path? I think this should be able with the field-Id but I have no idea how to make it work and I haven't found a hint in the manuals. Please take a look at my screenshot - there you can see that the second entry (id = is @id=spMF_7_3) is the 7th entry that I have added.

Thanks for your support,
Peter
xml_path.PNG
xml_path.PNG (13.76 KiB) Viewed 14781 times

Re: How to define an unique XML-Path

Posted: Wed May 17, 2017 8:34 pm
by cstevens
replace the node index [7] with something unique to that node. For example:

[Metadata.Text:Path="/field-list/field[@Id='spMF_7_3']/value",Dataset="Submit",Model="XML"]

That way the order of the elements doesn't matter.

Re: How to define an unique XML-Path

Posted: Fri May 19, 2017 7:58 pm
by NEOSA
As explained by cstevens, a shorter path can also be used :

//field[@Id='spMF_7_3']/value

"//" means :

//ename selects all ename elements in a document.

Re: How to define an unique XML-Path

Posted: Mon May 22, 2017 3:58 pm
by gabrielp