The issue is because the XML inside the <x:parse> tag is actually in the
"jelly:core" namespace. The XPath expressions you are using only match XML
in the empty "" namespace.
You can fix this by making this change...
From: "Jurgen DE JONGHE" <[EMAIL PROTECTED]>
> Hi,
> is it normal that the following code fails:
>
> <?xml version='1.0' encoding='windows-1252'?>
> <jelly xmlns="jelly:core" xmlns:x="jelly:xml">
>
> <x:parse var="doc">
> <a>
<a xmlns="">
> <b v="1"/>
> <b v="2"/>
> <b v="3"/>
> </a>
> </x:parse>
Funny you should mention namespace support in XPath - I'm just about to
commit a fix that will allow XPath expressions to make use of any namespace
prefixes that are available in the document within XPath expressions.
So you couild do something like this...
<?xml version='1.0' encoding='windows-1252'?>
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:foo="whatever">
<x:parse var="doc">
<a xmlns="whatever">
<b v="1"/>
<b v="2"/>
<b v="3"/>
</a>
</x:parse>
<x:forEach select="$doc/foo:a/foo:b" var="x">
...
or
<x:forEach select="$doc/z:a/z:b" var="x" xmlns:z="whatever">
...
I'm just testing this now - it should be available in CVS within the next 30
minutes or so...
James
-------
http://radio.weblogs.com/0112098/
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--
To unsubscribe, e-mail: <mailto:commons-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-user-help@;jakarta.apache.org>