• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML data cannot be retrieved

 
Deepshan Shetty
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am trying to connect to a remote Host.

I get a response but then it throws a exception like

Exception in xmlParseString::org.xml.sax.SAXParseException: Element type
"VerifyOutput" must be followed by either attribute specifications, ">" or "/>"


My XML output string is

<?xml version='1.0' encoding='UTF-8'?><VerifyOutput ITC='ABC' PRN ='2100001' CURRENCY = 'INR'PMTDATE ='2012-06-04'AMT ='1.0'STATUS='FAILED' > </VerifyOutput>

Can anyone help me knowing why and what case can this happen?

Regards
S V Shetty

 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there is no child / text content for VerifyOutput node, then it shall be either look like below.
<VerifyOutput></VerifyOutput> or <VerifyOutput/>

You get the ParseException when your XML is not valid. Change the node and check again.
 
Deepshan Shetty
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i get attributes right? Even then it shows the same exception??

<?xml version='1.0' encoding='UTF-8'?><VerifyOutput ITC='ABC' PRN ='2100001' CURRENCY = 'INR'PMTDATE ='2012-06-04'AMT ='1.0'STATUS='FAILED' > </VerifyOutput>

This is incorrect you mean??
 
Deepshan Shetty
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Can i know how can i retrieve such kind of a data from the tags without this exception??

The data must be in the same format.

<?xml version='1.0' encoding='UTF-8'?><VerifyOutput ITC='ABC' PRN ='2100001' CURRENCY = 'INR'PMTDATE ='2012-06-04'AMT ='1.0'STATUS='FAILED' > </VerifyOutput>

Regards
S V shetty
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I missed to see the VerifyOutput start tag. Why are you using single quote for attribute values? Replace it with double quotes.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Jai wrote:I missed to see the VerifyOutput start tag. Why are you using single quote for attribute values? Replace it with double quotes.


No, either type of quote is acceptable to delimit attribute values. The problem here is that there are attributes which are run together without spaces separating them:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic