Re: qualified name argument to startElement
Elliotte Rusty Harold <[email protected]> Wed, 28 Apr 2004 05:07:00 -0400
| Newsgroups | gmane.text.xml.sax.devel |
|---|---|
| Message-ID | <p06010201bcb522dd22a7@[192.168.254.88]> |
At 9:46 AM +0200 4/28/04, Mikael St=E5ldal wrote: >What *is* a qualified name then? And where is that specified? It's defined in section 4 of the Namespaces specification using BNF: In XML documents conforming to this=20 specification, some names (constructs=20 corresponding to the nonterminal Name) MUST be=20 given as qualified names, defined as follows: Qualified Name [6] QName ::=3D PrefixedName | UnprefixedName [6a] PrefixedName ::=3D Prefix ':' LocalPart [6b] UnprefixedName ::=3D LocalPart [7] Prefix ::=3D NCName [8] LocalPart ::=3D NCName Bottom line: a qualified name is any XML name=20 that does not contain an initial or trailing=20 colon, or more than one colon, or use a=20 non-namestart character after its only colon. An=20 element name in a document that does not use=20 namespaces is still a perfectly legal qualified=20 name, provided only that it does not use colons=20 in a way incompatible with the namespaces=20 specification. Indeed the SAX specification might be clearer if=20 we just called that argument "name" rather than=20 "qName". As it stands, a document that is=20 namespace incompatible due to multiple colons in=20 element names can't really be processed by SAX=20 because such an element has neither a local part=20 nor a qualified name. However, it does have a=20 name, and is well-formed though not namespace=20 well-formed. -- Elliotte Rusty Harold [email protected] Effective XML (Addison-Wesley, 2003) http://www.cafeconleche.org/books/effectivexml http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulai= tA ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click _______________________________________________ List: sax-devel, [email protected] See: http://www.saxproject.org/ https://lists.sourceforge.net/lists/listinfo/sax-devel