This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
lookup problem
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] lookup problem
- From: "Steve Renshaw" <renshaw_steve at hotmail dot com>
- Date: Tue, 16 Oct 2001 16:07:51 +0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
how do you do a simple lookup? i need the following lookup
function available !throughout! my XSLT:
Lookup('1') -> 'one'
Lookup('2') -> 'two'
LOokup('3') -> 'thre'
Lookup('4') -> 'four'
I tried the folloowing xslt without any luck. ANy help please?
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="MyKey" match="/root/a/b" use="/root/a/c"/>
<xsl:template match="/">
<xsl:value-of select="key('MyKey','1')"/><br/>
<xsl:value-of select="key('MyKey','2')"/><br/>
<xsl:value-of select="key('MyKey','3')"/><br/>
<xsl:value-of select="key('MyKey','4')"/><br/>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" ?>
<?xml:stylesheet type="text/xsl" href="style.xsl"?>
<root>
<a><b>1</b><c>one</c></a>
<a><b>2</b><c>two</c></a>
<a><b>3</b><c>three</c></a>
<a><b>4</b><c>four</c></a>
<BulkOfApplicationDataGoesHere/>
</root>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list