473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Wrong XML Format, java

Hi,

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"?>
<item>
<title><![CDATA[ A Black Dio Scooter on Sale ]> </title>
<link>http://www.chhito.com/index.php?page=item&id=266</link>
<guid>http://www.chhito.com/index.php?page=item&id=266</guid>
<description>
<![CDATA[
<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>
]]>
</description>
<pubDate>Tue, 03 Apr 2012 08:56:57 -0600</pubDate>
</item>
Apr 4 '12 #1
2 2296
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. &
with
Expand|Select|Wrap|Line Numbers
  1. &amp;
Expand|Select|Wrap|Line Numbers
  1. <link>http://www.chhito.com/index.php?page=item &amp;id=266</link>
  2. <guid>http://www.chhito.com/index.php?page=item &amp;id=266</guid>
Apr 4 '12 #2
Thanks for responding so soon
Apr 4 '12 #3

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

Similar topics

2
by: Zulik | last post by:
Hello, I have a problem with MessageDigest MD5 in Java. I want to calculate the digest from a file, encode it in base64 and display it. Now, according to MD5 spec, digest shall be 128 bits so,...
0
by: Kalle Anke | last post by:
Does a Java "pretty formatter" exist? I would like to use a Python based web building tool but would like to pretty format Java code (for example adding color to keywords, etc). I haven't...
4
by: indushekara | last post by:
Hi, We are having memory corruption in our application somewhere, unable to find out. one part of code we found that we are specifying wrong format specifier. Could anyone let me know if the...
0
by: GFro | last post by:
I have a calendar page that returns a date to a textbox on the parent page. It is returning the wrong format on the deployment server. On the development server the calendar returns to textbox in...
2
by: Big George | last post by:
Hello, Just looking for some feedback. I have an intermediate level of ASP.NET. Since some time ago, I liked to learn Java. However, my hughe problem is time: working many hours every day...
23
by: Martin Pöpping | last post by:
Hello, I´m relatively new in programming with C#. I want to design a class with can only be used in the same namespace. So I declared this class as protected, but the compiler gives me the...
2
by: geordietx | last post by:
Hi, I needed an answer to this question so I thought I'd find a Java forum that appeared to be friendly and tolerant of those who aren't well-versed in Java. Guess who won?? :-) In the last week,...
10
dmjpro
by: dmjpro | last post by:
Hi Experts. I have a problem with XML parsing. Please Help! <?xml version="1.0" encoding="UTF-8"?> <XML> <Debasis>some_value</Debasis> <DmjPro>some_another_value</DmjPro> <!--Some...
0
by: =?Utf-8?B?VmFuY291dmVyTWlrZQ==?= | last post by:
Hi there, I have a web app written in 1.1 in ASP.net and C#. In the web app, I need to compare two dates (from and to) from two textboxes on webpage to make sure the to date is greater than or...
6
by: safra | last post by:
hi everybody.. i need help with my assignment.i want to display a error message saying that the user has inputed a string where an integer is needed.because when i enter "h" (for an example) in the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.