cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rogier Peters" <>
Subject XPathDirGenerator and namespaces
Date Fri, 24 May 2002 10:54:54 GMT

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="">
	   <some:element xmlns:some="">
		<xhtml:p xmlns:xhtml="">some content</xhtml:p>

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="" (...)
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?


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 / 

To unsubscribe, e-mail:
For additional commands, email:

View raw message