# Java retrieving xml with quotation marks in text

**URL:** <https://forum.kirupa.com/t/java-retrieving-xml-with-quotation-marks-in-text/299722>\
**Category:** programming\
**Created:** [November 10, 2009, 2:37am UTC](https://forum.kirupa.com/t/java-retrieving-xml-with-quotation-marks-in-text/299722 "2009-11-10T02:37:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fireportal](https://avatars.discourse-cdn.com/v4/letter/f/d2c977/32.png) [@fireportal](https://forum.kirupa.com/u/fireportal)\
**Post date:** [November 10, 2009, 2:37am UTC](https://forum.kirupa.com/t/java-retrieving-xml-with-quotation-marks-in-text/299722/1 "2009-11-10T02:37:50Z")

</div>

Hi, i am new to java and currently have this code and it does not seem able to retrieve information from twitters containing double quotations. It will cut off the remarks. Not sure how to include those comments in too. Can someone help? very urgent thanks  
Example: @something " I need help!!"

the results returned is only: @something

Here is my code:

```auto
    XMLInputFactory inputFactory = XMLInputFactory.newInstance();
            InputStream in = [COLOR=navy] **new** [/COLOR] URL([COLOR=red]"http://search.twitter.com/search.atom?q="[/COLOR] + search + [COLOR=red]"&page=1&rpp=100"[/COLOR]).openStream();
            
            XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
       
            [COLOR=navy] **boolean** [/COLOR] inEntry = [COLOR=navy] **false** [/COLOR];
            Item currentItem = [COLOR=navy] **null** [/COLOR];
            
            [COLOR=navy] **while** [/COLOR] (eventReader.hasNext()) [COLOR=navy]{[/COLOR]      
               XMLEvent event = eventReader.nextEvent();
               
            
               [COLOR=navy] **if** [/COLOR] (event.isStartElement()) [COLOR=navy]{[/COLOR]
            	   StartElement startElement = event.asStartElement();
            
                   [COLOR=navy] **if** [/COLOR] (event.asStartElement().getName().getLocalPart().equals([COLOR=red]"title"[/COLOR])) [COLOR=navy]{[/COLOR]
                	   event = eventReader.nextEvent();
                	
                	   String title = event.asCharacters().getData();
                	   
                	   [COLOR=navy] **if** [/COLOR] (!inEntry) [COLOR=navy]{[/COLOR]
                		   channel.setTitle(title);[COLOR=darkgreen]//false[/COLOR]
                	   [COLOR=navy]}[/COLOR] [COLOR=navy] **else** [/COLOR] [COLOR=navy]{[/COLOR]
                		   currentItem.setTitle(title);[COLOR=darkgreen]//true[/COLOR]
                	   [COLOR=navy]}[/COLOR]
                	                          
                       [COLOR=navy] **continue** [/COLOR];

```
