commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: [jelly] xml and xsl fun
Date Fri, 12 Jul 2002 07:44:54 GMT
From: "Warner Onstine" <sw-list@warneronstine.com>
> One of my key things though isn't understanding the actual tags and how
they
> are used on the same document they live in, it's being able to use a
script
> 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
like..

<?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"/>
    </x:forEach>

</j:jelly>

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

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message