xml-xindice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henrik Vendelbo" <hvende...@bluprints.com>
Subject Re: Storing XML in string format
Date Wed, 22 Oct 2003 14:25:14 GMT
Hmm, look like a hack, but if it does the job I can live with it. I don't
quite understand why the string I pass isn't valid XML, which Xindice should
store properly. Or are you merely saying that I can speed up the DOM parsing
using a CDATA element ?

Does this mean that Xindice will go via DOM even if you use SAX ?

And will the CDATA wrap be removed before storing it in the db ?

----- Original Message ----- 
From: "Murray Altheim" <m.altheim@open.ac.uk>
To: <xindice-users@xml.apache.org>
Sent: Wednesday, October 22, 2003 3:03 PM
Subject: Re: Storing XML in string format


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



Mime
View raw message