Hi Carsten,
Thanks for your quick reply, but this doesn't seem to work. Still getting empty
results.
These are some sitemap fragments and corresponding results:
test 1:
<!-- simple xpathdir util using namespace -->
<map:match pattern="xnav/**">
<map:generate type="xpathdir"
src="../../webdav/tui/files/content/{1}#/resource[namespace-uri()='http://www.hippo.nl/xml/resource']"/>
<map:serialize/>
</map:match>
test 2:
<!-- simple xpathdir util -->
<map:match pattern="xpathdir/**">
<map:generate type="xpathdir"
src="../../webdav/tui/files/content/{1}#/child::node()"/>
<map:serialize/>
</map:match>
result 1:
<dir:directory name="persberichten" lastModified="1022149945866" date="5/23/02 12:32
PM" requested="true" xmlns:dir="http://apache.org/cocoon/directory/2.0">
<dir:file
name="Alessandro_Safina_vertelt_exclusief_voor_Holland_International_over_Toscane.xml"
lastModified="1022239378941" date="5/24/02 1:22 PM">
<dir:xpath
docid="Alessandro_Safina_vertelt_exclusief_voor_Holland_International_over_Toscane.xml"
query="/resource[namespace-uri()='http://www.hippo.nl/xml/resource']"/>
</dir:file>
(...)
result 2:
<dir:directory name="persberichten" lastModified="1022149945866" date="5/23/02 12:32
PM" requested="true" xmlns:dir="http://apache.org/cocoon/directory/2.0">
<dir:file
name="Alessandro_Safina_vertelt_exclusief_voor_Holland_International_over_Toscane.xml"
lastModified="1022239378941" date="5/24/02 1:22 PM">
<dir:xpath
docid="Alessandro_Safina_vertelt_exclusief_voor_Holland_International_over_Toscane.xml"
query="/child::node()">
<resource xmlns="http://www.hippo.nl/xml/resource">
<caption>Alessandro Safina vertelt exclusief voor
Holland International over Toscane</caption>
<index>58</index>
<layout>layout/Overzicht_pagina/Persberichten/Bericht.xml</layout>
<content>
<hc:content
xmlns:hc="http://www.hippo.nl/xml/hippocontent"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<hc:field
id="datum">25-4-2001<hc:Day>25</hc:Day>
<hc:Month>4</hc:Month>
<hc:Year>2001</hc:Year>
</hc:field>
<hc:field id="titel">
Alessandro Safina vertelt exclusief
voor Holland International over
Toscane��
</hc:field>
<hc:field id="inhoud">
<xhtml:p>Holland International
heeft
vanaf 28 april elke zaterdag een
charter naar Grosseto, Toscane.
Tijdens deze vlucht worden de
passagiers op een wel heel
bijzondere manier ge�nformeerd over
Toscane. De populaire Italiaanse
zanger Alessandro Safina, bekend
van de hit Luna, vertelt exclusief
voor Holland International over
deze prachtige streek in een tien
minuten durende video.</xhtml:p>
<xhtml:p>Deze film is
opgenomen tijdens
een rondvaart in de grachten van
Amsterdam. Alessandro, geboren en
getogen in Toscane, vertelt wat
Toscane voor hem zo bijzonder maakt
en wat de vakantieganger zeker moet
gaan bekijken. De bekende steden
als Siena en Florence komen aan
bod, maar Alessandro laat ook veel
zien van de schitterende natuur en
de, voor Toscane, karakteristieke
kleine oude dorpjes. Voor de
passagier zeer zeker een
verrassende en aangename start van
hun reis naar Toscane.</xhtml:p>
<xhtml:p>Einde
bericht</xhtml:p>
<xhtml:p>25 april
2001/05</xhtml:p>
<xhtml:p>
<xhtml:em>Noot voor de
redactie: Voor
meer informatie kunt u contact
opnemen met Patricia Egelie,
manager pers & public
relations, tel. (070)� 326 63
72.</xhtml:em>
</xhtml:p>
</hc:field>
</hc:content>
</content>
</resource>
</dir:xpath>
</dir:file>
(...)
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
> -----Oorspronkelijk bericht-----
> Van: Carsten Ziegeler [mailto:[EMAIL PROTECTED]]
> Verzonden: Friday, May 24, 2002 1:06 PM
> Aan: [EMAIL PROTECTED]
> Onderwerp: RE: XPathDirGenerator and namespaces
>
>
> If you use XPath, you can do something like
> resource[namespace-uri()='http://www.hippo.nl/xml/resource']/c
> aption[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]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]