xsl-list
[Top] [All Lists]

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

2006-09-07 09:07:21
 
When I run this in the browser,

a browser is a fairly hostile environment for debugging a stylesheet,
they are pretty much designed not to bother the users with scary things
like error messages, It's usually a good idea to debug first using a
command line or IDE based system.

Also note that depending on wher eyour main file is, there may be
browser security issues that prevent document(..) from loading external
resources.

What I am trying to achieve is to iterate over the filename and list
them in the browser.
It would seem that you don't want to use keys for that, just


    <xsl:for-each select="document('xmlFile.xml')/file/fileId">
                  <a class="hyperlink"
                  
href="javascript:selectXml('{(_at_)filename}','{(_at_)filepath}');">ccc</a>
</xsl:for-each>

 So where am I going wrong?
               <xsl:for-each select="document('xmlFile.xml')">
document() just selects 1 node (/) so this for-each just iterates once,
with . being the whole document.

                  <xsl:variable name="vXmlName"     
select="key('fileIndex',.)"/>
. there is taken to be the string value of the current node which is all
the character data in the docuemnt (which is just the white space used
for indentation, as all the real data is in attriubutes)

David


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>