xml-xindice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Murray Altheim <m.alth...@open.ac.uk>
Subject Re: default namespace problems
Date Fri, 30 Apr 2004 15:49:50 GMT
Vadim Gritsenko wrote:
> Steven Shand wrote:
> 
> 
>>Hi,
>>
>>I'm having some issues searching documents within a default namespace.
>>
>>if my document looks like
>>
>><node1 xmlns="http://foo.bar.com" >
>>    <bar>content</bar>
>></node1>
>>
>>I'd assume that I would do service.setNamespace( "",
>>"xmlns="http://foo.bar.com" )
>>
>>or even
>>
>>service.setNamespace( null, "xmlns="http://foo.bar.com" )
>>
>>neither of these work.
>>However if I add a prefix to my document like:
>>
>><foo:node1 xmlns:foo="http://foo.bar.com" >
>>    <foo:bar>content</foo:bar>
>></foo:node1>
>>
>>and do service.setNamespace( "foo", "xmlns="http://foo.bar.com" )
>>
>>my query works fine. Unfortunately this isn't a solution for me.
>>
>>I came across something in the archives which seemed to say that as
>>long as I called setNamespace() with the location value, it didn't
>>really matter what was passed as a prefix. I've tried this and it
>>certainly doesn't work.
>>
>>If anybody has some ideas on this I'd appreciate some feedback. It
>>seems like a very common use-case. I'm sure I must be missing
>>something.
>>I'm using the 1.1b4 build.
> 
> 
> 
> I tried
>     bin\xindice xpath -c /db/test -n ns -s a=http://foo.bar.com -q 
> "/a:foo/a:bar"
> with the document above and it did not work. Seems like a bug. If you 
> find a solution to it, send a patch to the dev list. In either case, you 
> can use bugzilla to track this issue.

Vadim,

Can't do much myself right now, but I did note on upgrading from 1.0
to 1.1 that the setNamespace() method had all changed and broken (?)
in the transition, so it's probably in the method itself. (If this
is any help...). In my own application code I just commented out all
of the setNamespace stuff since I've not yet got around to working
out my own bugs with XPath.

Murray

......................................................................
Murray Altheim                    http://kmi.open.ac.uk/people/murray/
Knowledge Media Institute
The Open University, Milton Keynes, Bucks, MK7 6AA, UK               .

   The Resume of George W. Bush
   http://www.buzzflash.com/contributors/03/04/23_resume.html


Mime
View raw message