How to define an unique XML-Path

Post Reply
pfischer
Newbie
Posts: 12
Joined: Tue May 14, 2013 4:57 pm

How to define an unique XML-Path

Post 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 14777 times
cstevens
Member
Posts: 40
Joined: Tue Feb 12, 2013 8:42 pm

Re: How to define an unique XML-Path

Post 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.
NEOSA
Newbie
Posts: 12
Joined: Thu Mar 10, 2016 6:31 pm

Re: How to define an unique XML-Path

Post 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.
User avatar
gabrielp
Advanced member
Posts: 577
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: How to define an unique XML-Path

Post by gabrielp »

Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Post Reply