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 February 18th, 2010, 10:42 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default Set the Base URI of the stylesheet

Hi,

I am using Saxon from the command line. My stylesheet pulls in xml files using the doc() function. The paths are relative to the input XML not the stylesheet. Is it possible to set the base-uri of the stylesheet to the same as the input xml?

Thank,
 
Old February 18th, 2010, 10:58 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The base URI is a static property - you can't change the base URI of the stylesheet at run-time.

However, you don't need to. The specification of doc() is that it resolves a relative URI relative to the stylesheet. We need to see exactly what you are doing so we can see what's going wrong.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old February 18th, 2010, 08:43 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Thank you Michael,

My stylesheet, input xml and xml fragments are all located in different folders.

for example

c:/data/stylesheets/my.xslt

c:/data/content/pm/input.xml

c:/data/content/dm/fragment.xml

c:/data/content/graphics/mygraphic.png

so in my fragement.xml file, there is attribute @href="../../graphics/mygraphic.png"

I need to resolve this to: c:/data/content/graphics/mygraphic.png

Its a bit hard to explain, so I apologize if I am not clear.

Thanks for the help
 
Old February 19th, 2010, 09:14 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

No need to apologize if you're not clear, just don't expect an answer.

I can't tell why your code isn't working, you haven't shown any code.

You'll find that by collecting together the information needed to explain the problem fully, you are more than half way to solving it.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 2, error uri cannot be resolved in either boylevel BOOK: Beginning JavaServer Pages 2 November 21st, 2007 12:54 PM
How do I get only the filename of the reffered URI shekhar_249 General .NET 1 August 25th, 2006 06:40 AM
Set base priority of exe lmadhavi Visual C++ 0 September 6th, 2004 05:00 AM
Referrer and Uri druid2112 General .NET 1 April 20th, 2004 12:54 PM





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