[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Pattern-Matching / Regular Expression Types
On 26/04/2012 22:45, Tiago Freitas wrote:
I need to match patterns on a set of XML documents (all with the same schema), and when a pattern matches, I need to retrieve the content and do some specific transformations on that content (no xml output needed). It's actually very hard to understand your notation, but I think that you just want something like <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template name="main"> <xsl:variable name="x" select="//ELEMENTx"/> <xsl:variable name="y" select="//ELEMENTy[@ATTRIBUTEz]"/> <xsl:variable name="w" select="//*[@ATTRIBUTEw]"/> <xsl:sequence select=" some $xi in $x satisfies some $yi in $y satisfies some $wi in $w satisfies ($xi << $yi) and ($yi << $wi) "/> </xsl:template> which returns true for <x> <ELEMENTy ATTRIBUTEz="1"/> <y><ELEMENTx/></y> <ELEMENTy ATTRIBUTEz="2"/> <k/> <l/> <KK ATTRIBUTEw=""/> <y><ELEMENTx/></y> </x>
|
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
|