Page 1 of 1

XML pickup tool

Posted: Tue Mar 29, 2011 3:50 pm
by sherczog
Can someone help me with the tool xml-pickup?

I want to catch a file as defined in an xml.



The flow gives an error: Failed to find asset ''
An xml file (called: testXml.xml) containing:







pad

E:test.txt






And in Powerswtich an Single-line text with variables defined: [Metadata.Text:Path="//field[tag=pad]/value",Dataset="Xml",Model="XML"].


Where do I go wrong?



XML pickup tool

Posted: Tue Mar 29, 2011 6:16 pm
by mattbeals
As far as I know this requires a script expression rather than a condition with variable. But I do not have a script that would do this.

XML pickup tool

Posted: Tue Mar 29, 2011 6:52 pm
by mattbeals
Here, try this:

http://www.mattbeals.com/misc/inject_job.zip

http://www.mattbeals.com/misc/inject_job2.zip



What I did was use the XML as the asset itself. Then I use the inject job to point to a fixed location where the job resides. All the metadata that comes inside the XML is preserved and can be used for routing/processing.



The second sample has a UNC path to the asset itself.

XML pickup tool

Posted: Wed Mar 30, 2011 10:07 am
by sherczog
It works!

Although I do not understand how. How does PowerSwitch know where the tag is for the path? In the manual it says : “the asset (the xml file) must contain data of the appropriate type..” What is the appropriate type?



The method in my original question (XMLpickup – Metadata refers to asset) suggests that the structure of the xml is flexible as long as your Xpath statement is correct... but that didn’t work, so I guess my logic is not sound.



Maybe Enfocus can provide with some more information...but for now I can use your solution.



thanx



XML pickup tool

Posted: Tue Apr 05, 2011 2:45 pm
by bens
sherczog wrote: And in Powerswtich an Single-line text with variables defined: [Metadata.Text:Path="//field[tag=pad]/value",Dataset="Xml",Model="XML"].
The xpath expression is not completely correct. Try this one:



[Metadata.Text:Path="//field[tag='pad']/value",Dataset="Xml",Model="XML"]