commons-user 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] making xml:expr case-insensitive
Date Thu, 19 Dec 2002 14:28:27 GMT
From: "Bernhard Wagner" <bw@xmlizer.biz>
> In the examples coming with the distribution of jelly there is
>
\jakarta-commons-sandbox\jelly\src\test\org\apache\commons\jelly\html\exampl
> e.jelly
>
> This script extracts the title of index.html using the xpath expression
> "$doc/html/head/title".
>
> If you change the case setting of any of the tags in index.html without
> adapting the xpath expression the title element is no longer found.
>
> My questions:
>
>   1) Can I configure html:parse to change the case setting of the
retrieved
> document? How?


The NeckoHTML parser already allows for this. I'll add these customisation
options to the Jelly tag in a moment.

>   2) Is there any transformer available that can change the case setting
of
> element and attribute names?

Yes. The HTML parser, NeckoHTML already does this.


>   3) Can I configure x:expr to ignore the case settings of the xpath
> expression given in the select attribute? How?

XPath can do this kinda thing but its inefficient and a bit ugly. e.g.
$doc/*[upper-case(name())='FOO']

Best to let the HTML parser do it. Gimme 10 minutes or so and I'll reply
when I've JellyUnit tested this feature...

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

Mime
View raw message