This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SAX + namespace" Watch "SAX + namespace" New topic
Author

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 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.


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

Joined: Jan 23, 2002
Posts: 11962
    
    5
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.
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: http://aspose.com/file-tools
 
subject: SAX + namespace
 
Similar Threads
NameSpaces doubt
problem with JAXP
Namespace in SAX...........
Simple Name & Qualified Name
namespace prefixes in attribute values