[xsl] Manipulating values from an xml file using xsl key

Subject: [xsl] Manipulating values from an xml file using xsl key
From: "Bansal, Rabinder" <RBansal@xxxxxxxxxxxxxxx>
Date: Thu, 7 Sep 2006 16:56:04 +0100
Hi

   I am trying to read the following xml file called xmlFile.xml:


   <?xml version="1.0" encoding="UTF-8"?>

<file>
  <fileId fileName="getClientDetails_Req.xml"
filePath="\\ifdwebapp1\www\docs\virginTest\client\xml"/>
  <fileId fileName="getPensions_Req.xml"
filePath="\\ifdwebapp1\www\docs\virginTest\client\xml"/>
  <fileId fileName="getRSF_ISA_Req.xml"
filePath="\\ifdwebapp1\www\docs\virginTest\client\xml"/>
 </file>


 In my xsl file I have coded the following:

   <xsl:key name="fileIndex" match="fileId" use="@fileName"/>
  <xsl:key name="fileDir" match="fileId" use="@filePath"/>

 ...

	       <xsl:for-each select="document('xmlFile.xml')">
	          <xsl:variable name="vXmlName"     select="key('fileIndex',.)"/>
	          <xsl:variable name="vXmlPathName" select="name()"/>

	          <a class="hyperlink"
href="javascript:selectXml('{$vXmlName}','{$vXmlPathName}');">ccc</a>
	       </xsl:for-each>

...

  When I run this in the browser, I get no results. What I am trying to
achieve is to iterate over the filename and list them in the browser. So where
am I going wrong?


Thanks in advance.




INTERNATIONAL FINANCIAL DATA SERVICES (UK) LTD Tel: +44 1268 44 3000
********************** N O T I C E *********************************

This message and any attachments is intended only for the individual or
company to which it is addressed and may contain
information which is privileged, confidential or prohibited from disclosure or
unauthorised use. If the recipient of this
transmission is not the intended recipient, or the employee or agent
responsible for delivering such materials to the
intended recipient, you are hereby notified that any use, any form of
reproduction, dissemination, copying, disclosure,
modification, distribution and/or publication of this e-mail message or its
attachments other than by it's intended
recipient is strictly prohibited by the sender. If you have received it in
error, please notify us immediately by
telephone on the number above and destroy the message and all copies in your
possession.

International Financial Data Services (UK) Ltd is authorised and regulated by
the Financial Services Authority.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

**********************************************************************

Current Thread