[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Manipulating values from an xml file using xsl key

Subject: Re: Manipulating values from an xml file using xsl key
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 7 Sep 2006 17:07:04 +0100
key value xml file
> 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('{@filename}','{@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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.