Page 1 of 1

Putting information from XML-Paths in an Array

Posted: Wed Apr 25, 2018 5:13 pm
by w2pcrew
Hello, I got a XML-File looking kind of like this:

<Report>
<PreflightResult errors="0" criticalfailures="0" noncriticalfailures="0" signoffs="0" fixes="0" warnings="2">
<PreflightResultEntry type="Check" level="warning">
<PreflightResultEntryMessage xml:lang="de-DE">
<Message>Number of pages is wrong </Message>
</PreflightResultEntryMessage>
</PreflightResultEntry>
<PreflightResultEntry type="Check" level="warning">
<PreflightResultEntryMessage xml:lang="de-DE">
<Message> Size is wrong</Message>
</PreflightResultEntryMessage>
</PreflightResultEntry>
...
</PreflightResult>
</Report>

Now I want to select all the "<message>"-tags. But i dont know how many there are, because every report can be different. So my idea was to select them in an array, and I could do this by using "Metadata.TextIndexed", but Switch shows an error that only a single path can be selected.

I hope I was able to describe my problem correctly, I'd be glad if someone maybe could help me.
Thanks in advance,
w2pcrew

Re: Putting information from XML-Paths in an Array

Posted: Wed Apr 25, 2018 6:28 pm
by Arthur
I would be inclined to say you need a XSLT transformation to return only the Message values in a new XML. This way you will have only what you need :)
But the XSLT is not so much of my fields of expertise, so should that be the case - I'd leave that to have more experienced folks here to help you with this :)

Re: Putting information from XML-Paths in an Array

Posted: Thu Apr 26, 2018 6:48 am
by r.zegwaard
When building the location path, you sould set the "Location path syntax" to "XPath expression" and then set "Result data type" to "Text Indexed".
This wil result in a ;-separated list.