Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 18th, 2004, 02:31 PM
Authorized User
 
Join Date: Nov 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to jkmyoung
Default xslt 2.0 document function

for xslt 1.0 and 1.1 I was passing a parameter file0="file:///C:\xslt\dis_message_module.xml". I then referenced it by
<xsl:variable name="FILE" select="document($file0)/root"/>

however, in xslt 2.0, (saxon 8B) I get a Warning: Invalid URI error. How must I change the parameter so that it works again?

(Note: I CAN NOT specify this path relatively to either the source xslt or xml document.)
 
Old November 18th, 2004, 03:02 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There's no change here between XSLT 1.0 and 2.0 - the difference is that Saxon has switched to using the Java java.net.URI class, which enforces the rules more strictly as to what constitutes a valid URI.

Try changing the backslashes to forward slashes.



Michael Kay
http://www.saxonica.com/
 
Old November 18th, 2004, 03:21 PM
Authorized User
 
Join Date: Nov 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to jkmyoung
Default

Thanks,
<xsl:variable name="FILE" select="document(translate($file0,'\','/')/root"/>
was easy changing it in the stylesheet.






Similar Threads
Thread Thread Starter Forum Replies Last Post
xslt document function.. maddukuri XSLT 8 May 16th, 2008 06:31 AM
Another Document ( ) Function Question bonekrusher XSLT 2 August 4th, 2006 10:45 AM
Document ( ) Function bonekrusher XSLT 5 August 4th, 2006 08:01 AM
xslt document() function problem with servlet meps XSLT 3 December 20th, 2005 10:34 AM
How to use document() function jacob XSLT 8 November 30th, 2005 08:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.