Gareth Reakes wrote:
Basically, it is an xmpp, http://www.jabber.org, implementation. I hook a tcp stream into a sax parser, and have that build a DOMDocument. Which I then use events generated by node insertions to move data objects into the application.Hi, Given your question, I assume you mean descendant nodes, and not child nodes (which are just the first level descendants). If you don't want to walk the DOM each time then you will have to cache the information some how. This is probably worth it if you dont have to change the document a lot. If speed is a real consideration then there are some patches lying around the Pathan tree somewhere which keep maps of node name/uri -> nodes in element as well as the standard list. You take the hit when you update the document then though.
Out of interest (and the possibility we can suggest a better way), why do you have to do this?
Gareth
So what I want to do, is quickly look at a 'stanza' in the DOMDocument to determine if it has any extensions, which are determined by different namespaces. Right now I am using the NodeFilter method, which works... but is not exactly efficient.
The XMPP/Jabber protocol is an xml document streamed over tcp, so there are constant updates to the DOMDocument.
thnx, Justin
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]