By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,643 Members | 1,320 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,643 IT Pros & Developers. It's quick & easy.

Wrong XML Format, java

P: 12

The below is my xml file.I have to parse this file.I'm using SAX parser.While parsing,it throws exception such as: "Wrong Xml Format" for the node <link>..

On the other hand the data of <title> node is not retrieved,it parses empty value.. but if i remove "<![CDATA[>" from the <title> node(or if the value of <title> node is only plain text i.e A Black Dio Scooter on Sale) then the parser successfully parse the value.Same goes with the <description> node.

Can anyone please help me to solve this problem?

<?xml version="1.0" encoding="iso-8859-1"?>
<title><![CDATA[ A Black Dio Scooter on Sale ]> </title>
<p>well protected by seat cover,helmet and bike cover also free.</p> <p>lu7pa 5270.</p> <p>well conditioned bike and one hand..</p> <p>around 15,000 km.</p> <p>self start.</p> <p>look like a fresh.</p> <p>No complain at all in the scooter.</p>
<pubDate>Tue, 03 Apr 2012 08:56:57 -0600</pubDate>
Apr 4 '12 #1
Share this Question
Share on Google+
2 Replies

P: 79
in the title tag ending square bracket
Expand|Select|Wrap|Line Numbers
is missing
replace with this

Expand|Select|Wrap|Line Numbers
  1. <title><![CDATA[ A Black Dio Scooter on Sale ]]> </title>
also you need to replace
Expand|Select|Wrap|Line Numbers
  1. &
Expand|Select|Wrap|Line Numbers
  1. &amp;
Expand|Select|Wrap|Line Numbers
  1. <link> &amp;id=266</link>
  2. <guid> &amp;id=266</guid>
Apr 4 '12 #2

P: 12
Thanks for responding so soon
Apr 4 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.