If you use XPath, you can do something like resource[namespace-uri()='http://www.hippo.nl/xml/resource']/caption[namespa ce-uri()='http://www.hippo.nl/xml/resource']
Does not look very pretty, but works. HTH Carsten > -----Original Message----- > From: Rogier Peters [mailto:[EMAIL PROTECTED]] > Sent: Friday, May 24, 2002 12:55 PM > To: [EMAIL PROTECTED] > Subject: XPathDirGenerator and namespaces > > > Hello, > > While testing the xpath directory generator i ran into the > following problem: > The xpath queries don't work on elements that are in a namespace > but don't have a prefix. > For instance if I run > somedir#/resource/caption|resource/index on the following xml > > <resource xmlns="http://www.hippo.nl/xml/resource"> > <caption>Pers</caption> > <index>4</index> > <layout>layout/Overzicht_pagina.xml</layout> > <content> > <some:element xmlns:some="http://www.some.org/some"> > <xhtml:p > xmlns:xhtml="http://www.w3.org/1999/xhtml">some content</xhtml:p> > </some:element> > </content> > </resource> > > the result is empty. > The same thing happens with xsl processing, but there the > solution is easy: i define the namespace in xsl as prefixed: > <xsl:stylesheet version="1.0" > xmlns:res="http://www.hippo.nl/xml/resource" (...) > this lets me call the element res:resource > > So I guess the solution would be something like letting the > XpathProcessor know which namespace binds to which prefix, but > I'm not sure how to do this. Other than changing the xml format > used, are there any ideas? > > Regards, > > Rogier Peters > > > --------------------------------------------------------- > Content Management Department > Hippo Webworks > Grasweg 35 > 1031 HW Amsterdam > The Netherlands > Tel +31 (0)20 6345173 > Fax +31 (0)20 6345179 > Rogier(at)hippo(dot)nl / www.hippo.nl > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]