commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: [jelly] xml and xsl fun
Date Fri, 12 Jul 2002 07:44:54 GMT
From: "Warner Onstine" <>
> One of my key things though isn't understanding the actual tags and how
> are used on the same document they live in, it's being able to use a
> on an external document.
> I think what Jason pointed me to might have the answer but I haven't had a
> chance to play yet.

Cool. BTW if its an XML document then using the XML tags makes it easy to
iterate & navigate over the XML via XPath.

e.g. to parse a document then evaluate an XPath expression you can do things

<?xml version="1.0"?>
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml">

    <x:parse var="doc" xml="foo.xml"/>

    <!-- lets evalute some xpath -->
    Some value is <x:expr select="$doc/foo/bar"/>

    <!-- now lets iterate over an XPath -->
    <x:forEach select="$doc//bar">
        Relative value is <x:expr select="xyz/@name"/>


There's a simple example of this in jelly/src/test/*/jelly/xml/example.jelly


Do You Yahoo!?
Get your free address at

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message