File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes SAX parser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SAX parser" Watch "SAX parser" New topic
Author

SAX parser

Manoj Zachariah
Ranch Hand

Joined: Dec 08, 2003
Posts: 65
public void startElement(String namespaceURI, String localName,String qName, Attributes attr) throws SAXException
in the event startElement, what is the difference between localName and qName.
thanks
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
The "local name" is the name of the element and "qname" (qualified name) is the namespace aware version, which includes the element's namespace prefix.


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

Joined: Dec 08, 2003
Posts: 65
i have a SAX parser and i tried
System.out.println(localName);
it justed printed blank lines. but when i tried
System.out.println(qName);
it printed correctly all the name correctly.
my xml file doesnt have any namespaces.
thanks in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SAX parser
 
Similar Threads
XML handler --> populate Hashmap
parameter in startElement() method
jdk1.4.2 SAX DefaultHandler characters method problem
How to stop parsing of a file with SAX
startElement not called, why not?