Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SAX + namespace

 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I use xerces and API Sax to parse an XML document.
That's what this doc looks like:

Now, I just want to the elements in defaut namespace http://www.nicholaschase.com/surveys/ to flagged in output.
So, the startElement() method may be this one:

I thought there would be merely "OK" as output for elements surveys, reponse, question since all these elements belong to the default namespace http://www.nicholaschase.com/surveys/.
Unfortunately, that's not the case and I get anything as output. I've checked that namespace are enabled by default in xerces.
I'm missing something here but don't know exactly what.
I would be very grateful for any assistance,
Regards,
Cyril.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try again with
 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lasse,
I've tried with equals too... No more success...
Can anyone provide a code snippet where namespaceURI is successfull used?
I don't understand what's wrong in my code
Cyril.
 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm, it looks odd...
I've added the two lines:

in my code, which are supposed to be the default configuration, and all is working now...
I'm perplex...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic