Wrong XML Format, java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • James Josh
    New Member
    • Mar 2012
    • 12

    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>
  • abhishekbrave
    New Member
    • Dec 2007
    • 79

    #2
    in the title tag ending square bracket
    Code:
    ]
    is missing
    replace with this

    Code:
    <title><![CDATA[ A Black Dio Scooter on Sale ]]> </title>
    also you need to replace
    Code:
    &
    with
    Code:
    &amp;
    Code:
    <link>http://www.chhito.com/index.php?page=item &amp;id=266</link>
    <guid>http://www.chhito.com/index.php?page=item &amp;id=266</guid>

    Comment

    • James Josh
      New Member
      • Mar 2012
      • 12

      #3
      Thanks for responding so soon

      Comment

      Working...