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

Re: xsl:key and document() loading external files.

Subject: Re: xsl:key and document() loading external files.
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 15 May 2007 08:51:53 +0200
Re:  xsl:key and document() loading external files.
Dale Tan wrote:

is there something I am not putting into my stylesheet that enables keys and the document() function to co-exist in my stylesheet?
At work i have been successful in implementing keys and using the document() function in the same stylesheet. But that is on a windows box.
I am working on a dreamhost system, php 5.2.1. I am either using the sablotron processor or libxslt, but am not 100% sure. I know that sounds a little silly, but I don't knew which proecessor i am using to transform my stylesheets. if anyone knows which i am using, please feel free to enlighten me.

Lookup the list guidelines: it has an instruction on how to get the version and name of any xslt processor. In short, you should use the following command somewhere in your stylesheet and note its output:


<xsl:value-of select="system-property('xsl:version')" />
<xsl:value-of select="system-property('xsl:vendor')" />


why would I be getting that error and not have my xml documents load up into my page?


You state that it does work on a windows box and that it does not work on a linux box. The most likely reason is a path problem. Are your paths equal on both systems? Can you try a small test with the following, silly, obfuscated way of outputting the stylesheet content itself? It uses both a key function and the document function. If you get an error with it about the path, then I think there's a bug with your processor. If you don't get an error about the path, then you should check the paths of your current XML:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

   <xsl:key name="t" match="xsl:variable" use="@name" />
   <xsl:variable name="test"  />

   <xsl:template match="/">
       <xsl:copy-of select="document(string(key('t', 'test')/@nothing))"/>
   </xsl:template>

</xsl:stylesheet>

call the above stylesheet with the stylesheet itself as XML input.

Cheers,
-- Abel Braaksma

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.