|
Subject: Re: [xsl] Pattern Matching in XSl - find groups defined in one Xml in another Xml. From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 21 Aug 2012 13:06:02 -0400 |
<xsl:function name="x:my-group" as="element(group)*">
<!-- returns any 'group' elements in groups.xml with child
nodes matching $me/@equipment by the 'grouped' key -->
<xsl:param name="me" as="element(alarm)"/>
<xsl:sequence
select="key('grouped',$me/@equipment,doc('groups.xml'))
/parent::group"/>
</xsl:function><xsl:template match="alarm">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:for-each select="x:my-group(.)">
<xsl:attribute name="found" select="@id"/>
</xsl:for-each>
</xsl:copy>
</xsl:template>Cheers, Wendell
-- ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Pattern Matching in XSl -, Kerry, Richard | Thread | RE: [xsl] Pattern Matching in XSl -, Kerry, Richard |
| Re: [xsl] XPath shorthand, Ihe Onwuka | Date | Re: [xsl] XPath shorthand, Andrew Welch |
| Month |