Henrik Vendelbo wrote:
I am playing around with JAXB persistence to Xindice, and was passing the
data as a String.

Apparently there was a parsing error, which is a bit surprising as it was
just marshalled from an object and looks fine as I can see. Anyway I noticed
DOM being involved. Is it converted to a DOM tree in order to check to see
if it is well formed ??

If so, how should I pass it, because creating a DOM tree seems quite a waste
of CPU and memory


The string that was passed : <data:MobileContract xmlns:data="http://commons.dspc.net/datamodel";>

<data:AccountName>henrik</data:AccountName><data:CustomerNo>2222222</data:Cu
stomerNo><data:ContractNo>123454</data:ContractNo><data:ContractType>std.bun
dle</data:ContractType><data:PersonName><data:First>Henrik</data:First><data
:Last>Vendelbo</data:Last></data:PersonName><data:CompanyName>BLUPRINTS</dat
a:CompanyName><data:MobileNo>07930416886</data:MobileNo>

<data:MobileNetwork>t-mobile.uk</data:MobileNetwork>

<data:HomeHostName>localhost</data:HomeHostName><data:HomePortNo>80</data:Ho
mePortNo></data:MobileContract>

Wrap any Strings containing markup within a CDATA section, which in XML looks like this:

   <![CDATA[ ......your content....  ]]>

You have to check that your content doesn't contain a "]]>" (escape
it if you do). You put this in an org.w3c.dom.CDATASection.

Murray

......................................................................
Murray Altheim                    http://kmi.open.ac.uk/people/murray/
Knowledge Media Institute
The Open University, Milton Keynes, Bucks, MK7 6AA, UK               .

  Monkeys use thoughts to control robotic arm
    http://www.sfgate.com/cgi-bin/article.cgi?file=/c/a/2003/10/13/MN2018.DTL
  Bush uses media expertly to push apocalyptic view
    http://truthout.org/docs_03/091403J.shtml



Reply via email to