Subject: Re: [xsl] Looking up keys in a separate xml file From: Scott Anguish <sanguish@xxxxxxxxxxx> Date: Tue, 6 Jan 2004 02:55:28 -0500 |
Your one XSLT stylesheet can match nodes from different documents just by saying:
<xsl:template match="descriptions">......
Where elsewhere in your document you do the push:
<xsl:apply-templates select="document('thedocument.xml')/descriptions"/>
If you have a <descriptions> element in both input files, then you could either use modes or you could qualify an ancestral element that is unique in each file.
<Items> <Item><Name>Item A</Name><InsertDescription lookup="a" /></Item> <Item><Name>Item B</Name><InsertDescription lookup="b" /></Item> <Item><Name>Item C</Name><InsertDescription lookup="a" /></Item> <Item><Name>Item D</Name><InsertDescription lookup="c" /></Item> <Item><Name>Item E</Name><InsertDescription lookup="a" /></Item> </Items>
<xsl:template match="InsertDescription"> <xsl:value-of select="key('descriptionlookup',@lookup)"/> <xsl:value-of select="@lookup" /> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Looking up keys in a sepa, G. Ken Holman | Thread | Re: [xsl] Looking up keys in a sepa, G. Ken Holman |
RE: [xsl] Maximum file size, Jim Fuller | Date | RE: [xsl] Continue seqlist numberin, David . Pawson |
Month |