• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to parse &

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using sax parser (jdk 1.4.2), the problem is that, value between the tag which contains & is ignored
eg., <Name>Credit&Card</Name>
When i parse and try to retrive the value between
<Name> tag --- the value returned to is "Credit". actually iam expecting "Credit&Card". Need ur help, how to fix this issue

[ May 20, 2005: Message edited by: Vetrik Kumaran ]
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried parsing the same string and got the results correctly

 
Vetrik Kumaran
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bajji,

Thanks for your reply , check the code below , was the problem due ot XMLReader or i am really missing anything.

SAXParserFactory spf = SAXParserFactory.newInstance();

spf.setNamespaceAware( true );
spf.setValidating( false );

SAXParser saxParser = spf.newSAXParser();
XMLReader xmlReader = saxParser.getXMLReader();
xmlReader.setContentHandler( new ParseTXT() );

xmlReader.parse( new InputSource( new FileInputStream( new File( sXMLFilePath ) ) ));

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic