Re: Problem with XPath query

From: Date: Mon, 14 Dec 2009 17:25:57 +0000
Subject: Re: Problem with XPath query
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-300493@lists.php.net to get a copy of this message
Hi, You are missing a quote after widgetType: [@alias="widgetType and @value="system"] should be [@alias="widgetType" and @value="system"] Regards, Jonathan On Mon, Dec 14, 2009 at 1:52 PM, Christoph Boget <christoph.boget@gmail.com> wrote: > Given the following XML: > > <Pages> >  <Page> >    <DisplayRef alias="Widget"> >      <parameter alias="widgetType" type="variable" > value="system"/> >    </DisplayRef> >  </Page> > </Pages> > > I'm using the following query: > > $oXPath->query( '//DisplayRef/parameter[@alias="widgetType and > @value="system"]' ); > > and I'm getting the following error: > > Warning: DOMXPath::query() [function.DOMXPath-query]: Invalid predicate > > If I remove this part of the query > > [@alias="widgetType and @value="system"] > > the error goes away. > > As far as I can tell from googling around, the query is valid.  If > that's the case, I don't understand what's causing the error. > Could someone explain to me what I'm doing wrong? > > thnx, > Christoph > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#300493) next »