Handling CDATA escaped XML in Freemarker -


i'm using freemarker in project transform 1 xml document another. due crappy design or choice of canonical message format our supplier has chosen embed xml in cdata escaped fields, chosen message standard not handle types of extensions. whatever reason need dig field , xpath queries.

say ie:

<invoice>   ..   <note><![cdata[<?xml version="1.0" encoding="utf-8"?><a><b>value</b></a>]]></note> </invoice> 

anyone has idea how value "a/b/text()" in kind of scenario?

i've thought trying clean cdata section manually , parse xml, hopes freemarker me.

freemarker doesn't parse xml, calls usual api-s that, freemarker can't here. have load xml file string (char[] or whatever), remove cdata "tags", parse resulting string dom tree javax.xml.parsers.documentbuilder, , pass freemarker. want call nodemode.simplify(thedomtree) before however.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -