Subject: Re: [xsl] Tricky inclusion match From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 31 Mar 2005 11:58:11 -0500 |
Seems a little bit too long.
This transformation:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes"/>
<xsl:variable name="vColors" select="/*/colors"/>
<xsl:template match="/"> <xsl:for-each select="/*/*/picture"> <xsl:if test="count($vColors/*[. = current()/color]) >= 2"> <xsl:value-of select="concat('Picture Id=', @sample, '
')"/> </xsl:if> </xsl:for-each> </xsl:template> </xsl:stylesheet>
when performed against the originally posted source xml document, produces the wanted result:
Picture Id=2 Picture Id=4 Picture Id=5
<xsl:apply-templates select="/*/*/picture[count($vColors/*[. = current()/color]) >= 2]" />
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] Tricky inclusion match, Dimitre Novatchev | Thread | Re: [xsl] Tricky inclusion match, Mukul Gandhi |
Re: [xsl] [ANN] DataPower Streaming, António Mota | Date | [xsl] Re:, Wendell Piez |
Month |