Hey,
On 27 Apr 2010, at 08:36, nishank837 wrote:
>
> Actually I did put the setNewline attribute for the serializer...
OK. Lets make sure everything is sane. In your code go and access the text of
the Attribute node and take a look whats in there. Confirm that the new lines
are in there. If they are then its definitely a serialisation issue.
> As far as the other question is concerned..actually I have a series of other
> nodes where I have numbers so I initially started off storing them as
> attributes for the Node ....But later I realized that sometimes these
> attributes can be XML's so was looking for a fix .
> And I have one more question if I store this as a CDATA element how can I
> aceess it ? As in for the other elements(DOMElement)... I can get the
> element by the Tag Name but The CDATA(DOMCDATASection) element doesnt have
> soemthing like that So How do I access it ?
>
If you put it in CDATA element then it will be the same as an attribute value -
the XML itself won't be parsed. Is there a reason you are not putting it as
content to a node? Like:
<item>
<info>
<label>ABB</label>
<description>Please</description>
</info>
<question id="TEacher" xsi:type="options">
</item>
That way the parser will check and make sure all the elements are closed etc.
Gareth
> nishank837 wrote:
>>
>> Hi,
>> I am having problems handling white space etc while parsing XML documents.
>> The data I want to be saved is somethign like this which include line
>> feeds and white spaces
>> <info>
>> <label>ABB</label>
>> <description>Please</description>
>> </info>
>>
>> <question id="TEacher" xsi:type="options">
>>
>> when I save this xml and parse it and get it i get something like this
>> <info> <label>ABB</label>
>> <description>Please</description></info><question id="TEacher"
>> xsi:type="options">
>> with all the line feeds stripped of.....Can someone let me know how I can
>> retain all these?
>> I am using the XercesC DOM parser
>>
>
> --
> View this message in context:
> http://old.nabble.com/Problems-with-White-Space-and-Line-Feed-Handling-tp28367855p28373844.html
> Sent from the Xerces - C - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Gareth Reakes, CTO WE7 - Great Music, Free
+44-20-7117-0809 http://www.we7.com