Re: Search elements with XPath

Peter Van der Beken <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Eugene Prokopiev wrote:
> doc.evaluate("/definitions/portType@name='PeopleService'/operations", 
> doc, "http://schemas.xmlsoap.org/wsdl/", XPathResult.ANY_TYPE, null);

> But I got:
> 
> Error: uncaught exception: [Exception... "Could not convert JavaScript 
> argument arg 2 [nsIDOMXPathEvaluator.evaluate]" nsresult: "0x80570009 
> (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: 
> file:///home/john/devel/xul/wsdl/wsdl.js :: analize :: line 4" data: no]

Maybe you should parse the error and read the spec: arg 2 in evaluate is 
of type XPathNSResolver, which is either an object (which you could 
create with createNSResolver) or a function mapping prefixes to uris, 
not a string.
And XPath doesn't have the concept of a default namespace, which you 
seem to be relying on here.

Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.