|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: regular expression question
While RegEx is a powerful tool and an absolutely wonderful addition to
XSLT in version 2.0 it's not something thats really going to make the
difference in making sample below possible... You can do it now in 1.0
using a combination of string functions, the contain function and either
an XML file that contains all possible ways the author may be referenced
or a combination of variables to act in the same capacity (the former
requiring much less code and being more inline with how XSLT was
designed to be used in the first place... a way to match element(s)
and/or attribute(s) patterns based on given criteria and output a given
set of data (static or dynamic) when the pattern is found.)
Something similar to the following would work using 1.0 (this example uses "citation" as the current context node): <xsl:variable name="author-variations" select="document('author.xml')/author/name" <xsl:if test="contains(preceding-sibling::text()[1], $author-variations/text-variations)"> output this... </xsl:if> The author.xml file is obviously just a foo example and as such the element structure and name usage is just a foobar represenation of what it might look like... but the concept is there and after being properly modified to fit your needs will give you what you want... Of course RegEx will make the process of finding a pattern with unlimited variations within a text node mere childs play... but to accomplish what you are attempting is definitely not the only way to do it. Hope this helps! <M:D/> Bruce D'Arcus wrote: I'm not really that familiar with regular expressions (beyond the basics), nor with the specifics of their implementation in XSLT 2.0. How easy is it to have regexp code that can take this:
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








