User bio
404 bio not found
Member since Dec 11, 2015
Posts:
Replies:
Hello
Yes probably. For the text that is before the XML block. The problem is that it is also text after the end tag. And the end tag can have different names.
Hello and thanks for your answers. However, it is not possible to parse the stream to %XML.TextReader as it is without the status reporting error. This is due to the fact that it is not a pure XML but rubbish from other content.
I probably have to sit and extract the XML content manually as Julius describes. Thought I could get away with it :0)
Certifications & Credly badges:
Michael has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Michael has no followers yet.
Following:
Michael has not followed anybody yet.
Thanks Manel
It worked great. Admittedly, I got the surrounding text out when I actually wanted the XML out. But by your example I was able to turn it around and get the XML out.
Working string: XMLstr
set xmlheadstart=$f(XMLstr,"<?xml ")-6
set xmlheadend=$f(XMLstr,">",xmlheadstart)-1
set firsttag=$tr($p($e(XMLstr,xmlheadend+1,*),">",1)_">",$c(13,10))
set tag=$p($e($p(firsttag," ",1),2,*),">",1)
set xmlend=$f(XMLstr,"</"_tag_">")
set NewXMLstr = $EXTRACT(XMLstr,xmlheadstart,xmlend-1)
Quit NewXMLstr
The NewXMLstr variable now contains the entire XML fragment.
Many thanks!
Regards Michael