Is it possible to use the xpath formatter to get the name of the current element?
Currently I am interested to get the name of the root element and get the content of an attribute on said element.
Is it possible to use the xpath formatter to get the name of the current element?
Currently I am interested to get the name of the root element and get the content of an attribute on said element.
Best answer by James B
In ArcScript, there is an xname function, similar to xpath, which will resolve the name of the element that you are looping on.
If you want a script that will determine the root element of an input XML file and promote it as a header on the message:
<arc:set attr="xml.uri" value="[filepath]" />
<arc:set attr="xml.xpath" value="/" />
<!-- the xname function evaluates the name of the current element -->
<arc:call op="xmlDOMSearch" item="xml">
<arc:set attr="output.header:XMLRoot" value="[xname]" />
</arc:call>
<!-- include the original file -->
<arc:set attr="output.filepath" value="[filepath]" />
<arc:push item="output" />
This should then add a header of XMLRoot to the output:

Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.