BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-19-2009, 10:01 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
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 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Then there must be something else wrong with the XML.
Offline  
Old 11-20-2009, 09:35 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

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

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


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

(5PCS) 2N6427 TRANS SS DARL NPN 500MA 40V TO92
$1.54
(5PCS) 2N6427 TRANS SS DARL NPN 500MA 40V TO92 picture(5PCS) FMMT734TA TRANS DARL PNP 100V 0.8A SOT23-3 734 FMMT734
$4.13
(5PCS) FMMT734TA TRANS DARL PNP 100V 0.8A SOT23-3 734 FMMT734 picture(5PCS) MMBT489LT1G TRANS GP SS NPN GP 30V 1A SOT23 489 MMBT489
$2.73
(5PCS) MMBT489LT1G TRANS GP SS NPN GP 30V 1A SOT23 489 MMBT489 picture(5PCS) CMH08A(TE12L,Q,M) DIODE SW SGL 400V 2A MFLAT CMH08A(TE12L CMH08 08A
$5.54
(5PCS) CMH08A(TE12L,Q,M) DIODE SW SGL 400V 2A MFLAT CMH08A(TE12L CMH08 08A pictureORIGINAL MOTOROLA TRANSISTOR 1N3795B
$19.99
ORIGINAL MOTOROLA TRANSISTOR 1N3795B picture






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