|
Subject: Re: [xsl] Checking external files based on the attribute value From: Peter Hickman <peter@xxxxxxxxxxxxx> Date: Wed, 13 Aug 2008 14:37:56 +0100 |
<?xml version="1.0"?> <doc> <graphic picfile="I970106058X_bulb"/> <graphic picfile="I970106058X_dummy"/> </doc>
<?xml version="1.0"?> <files> <file>./970106058X_c01_0002.tif</file> <file>./970106058X_c01_0001.tif</file> <file>./970106058X_bulb.tif</file> <file>./970106058X_0000.tif</file> <file>./970106058X_c01_0003.tif</file> </files>
<xsl:template match="/">
<doc>
<xsl:apply-templates/>
</doc>
</xsl:template> <node picfile="{@picfile}">
<xsl:attribute name="matched">
<xsl:choose>
<xsl:when test="$files/files/file[contains(.,$file)]">
<xsl:value-of select="true()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="false()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</node>
</xsl:template>
</xsl:stylesheet>peter@radish:~/xxx$ xsltproc process.xsl source.xml <?xml version="1.0"?> <doc> <node picfile="I970106058X_bulb" matched="true"/> <node picfile="I970106058X_dummy" matched="false"/> </doc> peter@radish:~/xxx$
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Checking external files b, Martin Honnen | Thread | Re: [xsl] Checking external files b, Darcy Parker |
| Re: [xsl] Checking external files b, Martin Honnen | Date | Re: [xsl] Checking external files b, Darcy Parker |
| Month |