Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel
Accepted Solution

Processing instruction target may not be 'XML'

Hi All,

 

I am getting an xml like this,

 

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetHotelDetailsXMLResponse xmlns="http://tempuri.org/"><GetHotelDetailsXMLResult><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getHotelDetailsXMLResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:HotelSearchBookkEngine"><getHotelDetailsXMLReturn xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns=""><?xml version="1.0" encoding="UTF-8"?> .............

 this document have xml definitions two times, and i am getting that error,

 

Any solution for this....

 

Thanks.

Please use plain text.
Developer
simon_hain
Posts: 16,042
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Processing instruction target may not be 'XML'

a xml parser requires valid xml, and this is obviously not valid, which i would attribute as a server-side bug.
if you cannot modify the server you have to work around that, downloading the xml as a string and modifying it (cutting off the invalid part) before parsing.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: Processing instruction target may not be 'XML'

Thanks for your reply simon,

 

I just replaced the definitions with empty string and now it is working fine.

 

Thanks. 

 

Please use plain text.