Sam WhitedThinking about matching handlers to XML elements while parsing as few tokens as possible more I think the way to do it is to match message and presence by type, IQs by type and the XMLName of the payload, and other top level elements by the XML name of the element (with options on all of those for wildcards so you can eg. match all IQs with a payload in a given namespace regardless of the local name).
Sam WhitedThen I can have specific handlers for each stanza type that get an unmarshaled version of the stanza start element with convenient helper methods (eg. an "IQ" struct with a reply method) and the generic handlers just get the XML token that caused the match and the remainder of the token stream.
Sam WhitedI feel like I've come to this conclusion before but forgot, I guess we'll see how it does in practice. </rubber-ducking>
flowSam Whited, FWIW I think what you name XMLName is often called QName (for qualified name)
ZashMatching on bare/full/host JID seems to have worked well in Prosody
KevKinda. Qualified names are within a particular document and use declarations.
KevAt least IIRC.
KevSo you can't talk about qnames generically outside the context of a particular document.
flowKev, for me QName is simply "element name" + "namespace of the element"
Sam WhitedFull name?
Sam Whitedyah, qname is a prefixed name like stream:stream according to wikipedia
flowI am not sure if the name being prefixed is the property that makes a name qualified. IIRC it is that you have a namespace together with the localpart (unqualified/local name)
flowIf you want or need to prefix the name is more a matter of the XML serialization routine
ralphmSo syntactically QName is one of PrefixedName or UnprefixedName. Abstractly, a QName is the namespace + prefix + local name.