BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 11-19-2009, 10:01 AM   #1
renuka_anil
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Question xml parsing leaving text after &

Please Login to Remove!

Hi All,


I am pasring an XML file using dom.


Here is my code snippet


DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
factory.setIgnoringComments(true);
factory.setIgnoringElementContentWhitespace(true);
factory.setExpandEntityReferences(false);
factory.setCoalescing(true);
factory.setValidating(false);
Document document = builder.parse( inStream );
vecData = new Vector(1, 1);
Element rootElement = document.getDocumentElement();
rootElement.normalize();


I have used getNodeValue() to retrieve node's value.

The text i am getting without the text after &..


like if i have node value as


http://imypage.ashx?imageurl=http%3a...128&height=128


Can any one help me in this.


Thanks & Regards,

Sachin
__________________
Crazy for BlackBerry
Offline  
Old 11-19-2009, 10:14 AM   #2
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

The amphersand '&' is a reserved character in an XML or HTML file - it needs to be encoded using the standard HTML entities, like &
Offline  
Old 11-20-2009, 01:08 AM   #3
renuka_anil
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Unhappy xml parsing leaving text after &

I am receiving an xml containing & as & still I did not get the text after &.

Can you please help me in this regard.

Any settings to be made for this.. I already place my code...

Thanks
__________________
Crazy for BlackBerry
Offline  
Old 11-20-2009, 08:49 AM   #4
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

Then there must be something else wrong with the XML.
Offline  
Old 11-20-2009, 09:35 AM   #5
renuka_anil
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Question xml parsing leaving text after &

Same xml will run fine for iphone and android application.

on blackberry when i tried to parse i am getting text before & only.


Thanks
__________________
Crazy for BlackBerry
Offline  
Old 11-20-2009, 10:50 AM   #6
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

Try replacing the & with the unicode equivalent: & # 38;

(spaces inserted to prevent the HTML editor from converting to '&' character)
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


USA Windows VPS RDP Server/ Windows VPS Hosting - 4GB RAM + 150GB HDD picture

USA Windows VPS RDP Server/ Windows VPS Hosting - 4GB RAM + 150GB HDD

$11.99



30 Server/Guest Pager Restaurant Paging System Kit by LRS Long Range Systems picture

30 Server/Guest Pager Restaurant Paging System Kit by LRS Long Range Systems

$299.99



Insulated Beverage Server/Dispenser 10 Gallon Hot & Cold Drinks w/ Thermometer picture

Insulated Beverage Server/Dispenser 10 Gallon Hot & Cold Drinks w/ Thermometer

$54.15



Wti Console Server + PDU CPM-800-1-EA picture

Wti Console Server + PDU CPM-800-1-EA

$550.00



ProSoft  PS-QS-1010-0780 QUICKSERVER FIELD SERVER, PSQS10100780 picture

ProSoft PS-QS-1010-0780 QUICKSERVER FIELD SERVER, PSQS10100780

$164.99



Server SE-SS 07020 Server Express Single Drop-In - NEW - COMPLETE - Genuine OEM picture

Server SE-SS 07020 Server Express Single Drop-In - NEW - COMPLETE - Genuine OEM

$180.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.