Hi -
I am using xmlbeans to parse a chunk of xml. Some of the fields may
contain encoded html.
Sometimes in the parsing process, the html gets decoded and the value of
the field gets wrapped in cdata (which is exactly what I want). For
instance:
Field before parsing:
<text><p> Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
</p><p> Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt mollit anim id est laborum.
</p><p> Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt mollit anim id est laborum.
</p></text>
Field after parsing:
<sch:text><![CDATA[<p> Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum. </p><p>
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
officia deserunt mollit anim id est laborum. </p><p> Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum. </p>]]></sch:text>
However, sometimes this does not happen - for instance:
Field before parsing:
<text><p> >Some sample data here</p></text>
Field after parsing
<sch:text><p>Some sample data here</p></sch:text>
I'm using the following XmlOptions:
XmlOptions opts = new XmlOptions();
Map<String, String> ns = new HashMap<String,
String>();
ns.put("", "http://www.mynamespace.com/");
opts.setLoadSubstituteNamespaces(ns);
contentDetailXml =
ContentDetailXmlDocument.Factory.parse(
contentDetail, opts);
Any ideas as to what might be going on here? I've tried using
setLoadUseDefaultResolver with no luck.
Thanks in advance for any help!
Kristen
The information contained in this email and any attachments may be private and
is the confidential property of Molecular and its affiliates. If you are not
the intended recipient(s) or have otherwise received this email unlawfully or
in error, please delete this email and inform the sender as soon as possible.
This email may not be disclosed, stored, used, published or copied by anyone
other than the intended recipient(s).