Replacing an XPath with a Regex? 2003-09-08 - By Santiago Pericas-Geertsen
Elizabeth Barham wrote:
>What I'm working on right now lacks recursion and perhaps, Lord >willing, I can re-work it sometime in the future, but does replacing >an XPath object with some kind of regular-expression object sound >feasible? > You could try defining a boolean function in Java and calling it from a predicate. The implementation of the Java function can use any off-the-shelve regexp package (e.g. Apache's) to do the matching. You'd then write something like:
<xsl:apply-templates select="*[java:your-boolean-function(name())]"/>
and similarly for xsl:template.
Hope this helps.
-- Santiago
|
|