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
How to define an unique XML-Path
Re: How to define an unique XML-Path
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.
[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
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.
//field[@Id='spMF_7_3']/value
"//" means :
//ename selects all ename elements in a document.
Re: How to define an unique XML-Path
Here is a writeup of this: https://github.com/open-automation/swit ... predicates
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix