The moose likes XML and Related Technologies and the fly likes SAX + namespace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SAX + namespace" Watch "SAX + namespace" New topic

SAX + namespace

cyril vidal
Ranch Hand

Joined: Jul 02, 2003
Posts: 247
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 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
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,

SCJP 1.4, SCWCD, SCBCD, IBM XML, IBM Websphere 285, IBM Websphere 287
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Try again with

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
cyril vidal
Ranch Hand

Joined: Jul 02, 2003
Posts: 247
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 vidal
Ranch Hand

Joined: Jul 02, 2003
Posts: 247
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...
I agree. Here's the link:
subject: SAX + namespace
It's not a secret anymore!