Hi Andy, The startElemnt() tag syntax (which I assume You picked up from the org.xml.sax.ContentHandler interface) is better defined as public void startElemnt(string namespaceURI, string localName, string fullName, Attributes attributes) Before going into the definition of the names, consider the following element <p:name xmlns ="http://www.clearMyDoubts/XML/names" ></p:name> In teh above case the elemnt "name" belongs to the namespace "p" defined by "http://www.clearMyDoubts/XML/names" simpleName(sName) or localName = Just the name of the elemnt which is just the name of teh elemnt, without teh namespace it is associated with !!. In our case it will be --> name qualifiedName(qName) or fullName = The full name of teh elemnt , including the namespace it is associated with, that is, the name of teh elemnt along with the prefix !!. In our case here it will be --> p:name
Hi Andy, You dint define the name space for p Here is your definition: 1.<?xml version="1.0"?> 2.<p:name xmlns ="http://www.clearMyDoubts/XML/names"> </p:name> In Line 2, you have to define waht namespace p occupies. So it should be "xmlns :p " instead of "xmlns". That is why, you are geting teh namespace as blank !! Unfortunately, in my previous posting, "xmlns :p " was converted to a smiley face, becase of teh quoataion ":" .. Sorry about that
Hari thanx once again for the instant reply.. this time i tried with <?xml version="1.0"?> <p:name xmlns ="http://www.clearMyDoubts/XML/names"></p:name> but unfortunately i m getting the same result .. blank namespace..blank simplename, QName = p:name Any idea???
Share Knowledge to gain it.
SCJP 2, SCWCD 2, SCDJWS, IBM 141 (In Progress), IBM 486 (Next)
what are you using andy? I think you might be using teh sax package from java ? let me know ..in nay case here is teh link to my source files ... http://www1.coe.neu.edu/~hari/html/tutorials/xml/src/SAX/ Good Luck If you still face problems, post the code..lets debug it together
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
a bit of art, as a gift, that will fit in a stocking