[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-user
Subject:    RE: xml parsing issue, xmlbeans version 2.4
From:       "Kristen Roth" <kristen.roth () molecular ! com>
Date:       2009-09-09 21:41:24
Message-ID: 283262EF07E2EA4F96DE5B7AEA3D1725012940A1 () USBOS4EVM01 ! americas ! media ! global ! loc
[Download RAW message or body]

Hi Cezar -

 

Thank you very much for your response.  I think I understand the
algorithm - but I'm not sure I fully understand how those options can be
used.  I'm using xmlbeans for parsing only - I am not saving the parsed
xml.  As you'll see from this code snippet:

 

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);

 

 

I'm just parsing the input string, which is valid xml, then passing the
result on to another part of my code.  Can I still control the use of
cdata without saving?

 

Thanks!

Kristen

 

From: Cezar Andrei [mailto:cezar.andrei@oracle.com] 
Sent: Wednesday, September 09, 2009 5:08 PM
To: user@xmlbeans.apache.org
Subject: RE: xml parsing issue, xmlbeans version 2.4

 

Hi Kristen,

 

The in-memory representation of the text after XMLBeans parsing is with
all entities decoded, when you save it back XMLBeans has to use CDATA or
encoded entities to have a well formed xml representation. By default
XMLBeans uses an algorithm to minimize the length of the message, but
you can control the use of CDATA see this wiki page for details:

http://wiki.apache.org/xmlbeans/CdataOptions

 

Cezar

 


 
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).  
________________________________


From: Kristen Roth [mailto:kristen.roth@molecular.com] 
Sent: Thursday, September 03, 2009 3:12 PM
To: user@xmlbeans.apache.org
Subject: xml parsing issue, xmlbeans version 2.4

 

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>&lt;p&gt; Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
&lt;/p&gt;&lt;p&gt; Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt mollit anim id est laborum.
&lt;/p&gt;&lt;p&gt; Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt mollit anim id est laborum.
&lt;/p&gt;</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>&lt;p&gt; >Some sample data here&lt;/p&gt;</text>

 

Field after parsing

<sch:text>&lt;p>Some sample data here&lt;/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).

 


[Attachment #3 (text/html)]

<HTML xmlns="http://www.w3.org/TR/REC-html40" \
xmlns:a="urn:schemas-microsoft-com:office:access" \
xmlns:b="urn:schemas-microsoft-com:office:publisher" \
xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:D="DAV:" \
xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" \
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" \
xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" \
xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" \
xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" \
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" \
xmlns:ec="http://www.w3.org/2001/04/xmlenc#" \
xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" \
xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" \
xmlns:html="http://www.w3.org/TR/REC-html40" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" \
xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" \
xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" \
xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:oa="urn:schemas-microsoft-com:office:activation" \
xmlns:odc="urn:schemas-microsoft-com:office:odc" \
xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" \
xmlns:p="urn:schemas-microsoft-com:office:powerpoint" \
xmlns:ppda="http://www.passport.com/NameSpace.xsd" \
xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" \
xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" \
xmlns:Repl="http://schemas.microsoft.com/repl/" \
xmlns:rs="urn:schemas-microsoft-com:rowset" \
xmlns:rtc="http://microsoft.com/officenet/conferencing" \
xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" \
xmlns:sp="http://schemas.microsoft.com/sharepoint/" \
xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" \
xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" \
xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" \
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:st="&#1;" \
xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" \
xmlns:udc="http://schemas.microsoft.com/data/udc" \
xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" \
xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" \
xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" \
xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" \
xmlns:x="urn:schemas-microsoft-com:office:excel" \
xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" \
xmlns:xsd="http://www.w3.org/2001/XMLSchema" \
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
xmlns:Z="urn:schemas-microsoft-com:"><head><META content="text/html; charset=utf-8" \
http-equiv="Content-Type">

<STYLE><!-- /* Style Definitions */ p.9f51cc9a-21a4-4959-af1f-5044652f9ef6, \
li.9f51cc9a-21a4-4959-af1f-5044652f9ef6, div.9f51cc9a-21a4-4959-af1f-5044652f9ef6, \
table.9f51cc9a-21a4-4959-af1f-5044652f9ef6Table	{margin:0cm; \
margin-bottom:.0001pt;}div.Section1 {page:Section1;}--></STYLE>

<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<meta content="Microsoft Word 12 (filtered medium)" name=Generator>
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:"Lucida Sans";
	panose-1:2 11 6 2 3 5 4 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
p.code, li.code, div.code
	{mso-style-name:code;
	margin:0in;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Lucida Sans","sans-serif";
	color:navy;}
p.e764d4cd-9968-4988-889a-e872b808f128, li.e764d4cd-9968-4988-889a-e872b808f128, \
div.e764d4cd-9968-4988-889a-e872b808f128  \
{mso-style-name:e764d4cd-9968-4988-889a-e872b808f128;  margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
span.EmailStyle20
	{mso-style-type:personal;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.EmailStyle21
	{mso-style-type:personal;
	font-family:"Arial","sans-serif";
	color:navy;}
span.EmailStyle23
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head><BODY>
<P CLASS="9f51cc9a-21a4-4959-af1f-5044652f9ef6"><FONT FACE="Arial" SIZE="2">

<div class=Section1>

<p class=MsoNormal><span style='color:#1F497D'>Hi Cezar &#8211;<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>Thank you very much for your
response.&nbsp; I think I understand the algorithm &#8211; but I&#8217;m not
sure I fully understand how those options can be used.&nbsp; I&#8217;m using
xmlbeans for parsing only &#8211; I am not saving the parsed xml.&nbsp; As \
you&#8217;ll see from this code snippet:<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>XmlOptions opts = </span><b><span \
style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span \
style='font-size:10.0pt;font-family:"Courier New";color:black'> \
XmlOptions();</span><span style='font-size:10.0pt;font-family:"Courier \
New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier \
New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 Map&lt;String, String&gt; ns = </span><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#7F0055'>new</span></b><span style='font-size:
10.0pt;font-family:"Courier New";color:black'> HashMap&lt;String, \
String&gt;();</span><span style='font-size:10.0pt;font-family:"Courier \
New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier \
New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 ns.put(</span><span style='font-size:10.0pt;font-family:"Courier New";
color:#2A00FF'>&quot;&quot;</span><span style='font-size:10.0pt;font-family:
"Courier New";color:black'>, </span><span style='font-size:10.0pt;font-family:
"Courier New";color:#2A00FF'>&quot;<a \
href="http://www.mynamespace.com/">http://www.mynamespace.com/</a>&quot;</span><span \
style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier \
New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 opts.setLoadSubstituteNamespaces(ns);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style='font-size:10.0pt;font-family:
"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier \
New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </span><span style='font-size:10.0pt;font-family:"Courier \
New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier \
New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 contentDetailXml = ContentDetailXmlDocument.Factory.parse(</span><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 contentDetail, opts);<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>I&#8217;m just parsing the input
string, which is valid xml, then passing the result on to another part of my
code.&nbsp; Can I still control the use of cdata without \
saving?<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>Thanks!<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>Kristen<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

</FONT></P>
<P CLASS="9f51cc9a-21a4-4959-af1f-5044652f9ef6">&nbsp;</P>
<P CLASS="9f51cc9a-21a4-4959-af1f-5044652f9ef6"><SPAN STYLE="FONT-SIZE: 11pt; \
FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: Calibri; \
mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; \
mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: \
AR-SA"><FONT SIZE="2"><EM>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).</EM></FONT></SPAN></P> <P \
CLASS="9f51cc9a-21a4-4959-af1f-5044652f9ef6"><SPAN STYLE="FONT-SIZE: 11pt; \
FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: Calibri; \
mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; \
mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: \
AR-SA"><FONT FACE="Arial" SIZE="2"></FONT></SPAN>&nbsp;</P> <P \
CLASS="9f51cc9a-21a4-4959-af1f-5044652f9ef6"><SPAN STYLE="FONT-SIZE: 11pt; \
FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: Calibri; \
mso-fareast-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; \
mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: \
AR-SA"><FONT FACE="Arial" SIZE="2"></FONT></SPAN></P> <P><FONT FACE="Arial" SIZE="2">

<p class=MsoNormal><b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Cezar Andrei \
[mailto:cezar.andrei@oracle.com] <br> <b>Sent:</b> Wednesday, September 09, 2009 5:08 \
PM<br> <b>To:</b> user@xmlbeans.apache.org<br>
<b>Subject:</b> RE: xml parsing issue, xmlbeans version 2.4<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Hi Kristen,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>The in-memory representation of the text after XMLBeans parsing is
with all entities decoded, when you save it back XMLBeans has to use CDATA or
encoded entities to have a well formed xml representation. By default XMLBeans
uses an algorithm to minimize the length of the message, but you can control
the use of CDATA see this wiki page for details:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><a href="http://wiki.apache.org/xmlbeans/CdataOptions">http://wiki.apache.org/xmlbeans/CdataOptions</a><o:p></o:p></span></p>


<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'>Cezar<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:navy'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div align=center class=MsoNormal style='text-align:center'><span \
style='font-size:12.0pt;font-family:"Times New Roman","serif"'>

<hr align=center size=2 width="100%">

</span></div>

<p class=MsoNormal><b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Kristen Roth \
[mailto:kristen.roth@molecular.com] <br> <b>Sent:</b> Thursday, September 03, 2009 \
3:12 PM<br> <b>To:</b> user@xmlbeans.apache.org<br>
<b>Subject:</b> xml parsing issue, xmlbeans version 2.4</span><span \
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Hi &#8211; <o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I am using xmlbeans to parse a chunk of xml.&nbsp; Some of
the fields may contain encoded html.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>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).&nbsp; For instance:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Field before parsing:<o:p></o:p></p>

<p class=MsoNormal>&lt;text&gt;&amp;lt;p&amp;gt; Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est
laborum. &amp;lt;/p&amp;gt;&amp;lt;p&amp;gt; Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt; Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
&amp;lt;/p&amp;gt;&lt;/text&gt;<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Field after parsing:<o:p></o:p></p>

<p class=MsoNormal>&lt;sch:text&gt;&lt;![CDATA[&lt;p&gt; Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim
id est laborum. &lt;/p&gt;&lt;p&gt; Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
&lt;/p&gt;&lt;p&gt; Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
&lt;/p&gt;]]&gt;&lt;/sch:text&gt;<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>However, sometimes this does not happen &#8211; for
instance:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Field before parsing:<o:p></o:p></p>

<p class=MsoNormal>&lt;text&gt;&amp;lt;p&amp;gt; &gt;Some sample data
here&amp;lt;/p&amp;gt;&lt;/text&gt;<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Field after parsing<o:p></o:p></p>

<p class=MsoNormal>&lt;sch:text&gt;&amp;lt;p&gt;Some sample data
here&amp;lt;/p&gt;&lt;/sch:text&gt;<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I&#8217;m using the following XmlOptions:<o:p></o:p></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>XmlOptions opts = </span><b><span \
style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span \
style='font-size:10.0pt;font-family:"Courier New";color:black'> \
XmlOptions();</span><span style='font-size:10.0pt;font-family:"Courier \
New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier \
New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 Map&lt;String, String&gt; ns = </span><b><span style='font-size:10.0pt;
font-family:"Courier New";color:#7F0055'>new</span></b><span style='font-size:
10.0pt;font-family:"Courier New";color:black'> HashMap&lt;String, \
String&gt;();</span><span style='font-size:10.0pt;font-family:"Courier \
New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier \
New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 ns.put(</span><span style='font-size:10.0pt;font-family:"Courier New";
color:#2A00FF'>&quot;&quot;</span><span style='font-size:10.0pt;font-family:
"Courier New";color:black'>, </span><span style='font-size:10.0pt;font-family:
"Courier New";color:#2A00FF'>&quot;<a \
href="http://www.mynamespace.com/">http://www.mynamespace.com/</a>&quot;</span><span \
style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier \
New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 opts.setLoadSubstituteNamespaces(ns);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style='font-size:10.0pt;font-family:
"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier \
New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </span><span style='font-size:10.0pt;font-family:"Courier \
New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier \
New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 contentDetailXml = ContentDetailXmlDocument.Factory.parse(</span><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& \
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 contentDetail, opts);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal>Any ideas as to what might be going on here?&nbsp;
I&#8217;ve tried using <span style='font-size:10.0pt;font-family:"Courier New";
color:black'>setLoadUseDefaultResolver</span><span style='font-size:10.0pt;
color:black'> with no luck.&nbsp; <o:p></o:p></span></p>

<p class=MsoNormal><span \
style='font-size:10.0pt;color:black'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;color:black'>Thanks in advance
for any help!<o:p></o:p></span></p>

<p class=MsoNormal><span \
style='font-size:10.0pt;color:black'>Kristen</span><o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=e764d4cd-9968-4988-889a-e872b808f128>&nbsp;<o:p></o:p></p>

<p class=e764d4cd-9968-4988-889a-e872b808f128><em><span style='font-size:10.0pt;
font-family:"Calibri","sans-serif"'>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).</span></em><o:p></o:p></p>

<p class=e764d4cd-9968-4988-889a-e872b808f128>&nbsp;<o:p></o:p></p>

</div>

</div>

</FONT></P><SPAN></SPAN></BODY></HTML>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic