[Twisted-Python] Help using XmlStreamFactory & XmlStream : XPathQuery error?

Christopher Zorn christopher.zorn at gmail.com
Tue Feb 19 09:11:53 EST 2008


On Feb 19, 2008 8:54 AM, Jean-Paul Calderone <exarkun at divmod.com> wrote:

> On Tue, 19 Feb 2008 12:29:38 +0100, Gabriel Rossetti <
> mailing_lists at evotex.ch> wrote:
> > [snip]
> >Ok, I've got some code sort of working, if I use the following XPathQuery
> >string : "/*" on the following XML string :
> >
> ><?xml version="1.0" encoding="utf-8"?>
> ><test><feed name="test">toto</feed></test>
> >
> >the addObserver works ( xs.addObserver("/*", self.onTest) )
> >but if I try the following :
> >
> >
> >xs.addObserver("/test/feed/@name", self.onTest)
> >or
> >xs.addObserver(xpath.XPathQuery("/test/feed/@name"), self.onTest)
> >
>
> I don't think the xpath implementation in xish is complete.  You may
> have found a bug or a case it doesn't handle.
>

It is not complete. But if you would like to find the stanza 'feed' with the
attribute 'name' then it would like like

xs.addObserver("/test/feed[@name]", self.onTest)




>
> Jean-Paul
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20080219/17b11bca/attachment.htm 


More information about the Twisted-Python mailing list