You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-user@xml.apache.org by Michael Lancaster <m....@ph.unimelb.edu.au> on 2004/06/13 15:46:58 UTC

xpath with namespace syntax. query returns no results.

hello,

i have been having difficulty performing a relatively simple xpath 
query;

<?xml version="1.0"?>
<foo xmlns="http://somenamespace.com/" />

query= "declare namespace x='http://somenamespace.com/' /x:foo[1]"
fails

query= "/x:foo[1]"
succeds if no namespace defined...

query= "declare namespace x='http://somenamespace.com/' /x:foo"
succeeds

the combination of namespace *and* a predicate seems to make the query 
fail.

i suspect that this is caused by the fact that when xmlbeans detects a 
predicate, it classes the xpath query as 'complex' and passes it to 
jaxen. this is all fine, but because i have been using the syntax as 
described in the javadoc:

"declare namespace x='http://somenamespace.com/' /x:foo[1]"

i think that jaxen does not understand this syntax...

how do i tell jaxen about my namespace, in such a way that simple 
queries will not fail when they are parsed by xmlbeans and *not* passed 
to jaxen?

thanks in advance,

michael 


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/