You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Leszek Gawron <lg...@mobilebox.pl> on 2005/05/29 11:26:22 UTC

[Fwd: jxpath and namespaces]

What do you say if we extend JXTemplateGenerator ExpressionContext with 
namespaces support? Every namespace that is registered on the jxtg 
template could also be registered at JXPathContext.

Read the mail from users@cocoon below.

-------- Original Message --------
Subject: jxpath and namespaces
Date: Sat, 28 May 2005 22:11:37 +0200
From: Zbigniew Bomert OP <zb...@dominikanie.pl>
Reply-To: users@cocoon.apache.org
To: users@cocoon.apache.org

In many places one can use jxpath expressions, but I didn't find, how
one can define namespace prefix for use in jxpath, for instance:

	#{data/m:mods/...}

Is there realy no mean to do it? It would be large limitation...

I know, I can use local-name() function:

	#{data/*[local-name()='mods']/...}

but with longer paths it's ... well, not elegant. Any suggestions?

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Re: [Fwd: jxpath and namespaces]

Posted by Sylvain Wallez <sy...@apache.org>.
Leszek Gawron wrote:

> What do you say if we extend JXTemplateGenerator ExpressionContext 
> with namespaces support? Every namespace that is registered on the 
> jxtg template could also be registered at JXPathContext.


Definitely needed, as not seeing the document's namespaces from XPath 
expressions can only bring confusion and weird behaviors :-)

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: [Fwd: jxpath and namespaces]

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Leszek Gawron wrote:
> What do you say if we extend JXTemplateGenerator ExpressionContext with 
> namespaces support? Every namespace that is registered on the jxtg 
> template could also be registered at JXPathContext.

Sound usefull, any idea about how to implement it?

/Daniel