[Home] [By Thread] [By Date] [Recent Entries]
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>
|

Cart



