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 July 19th, 2007, 02:54 PM
Registered User
 
Join Date: Jul 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default xsl import/include mapping

I need to create a script that will tell me what files a specific xsl file imports/includes and the path names to each. I am having trouble trying to figure out how to do this.

Someone recommended using perl, but I am not that familiar with either perl or xslt. I have played around a little with both, but I'm no expert.

I also found an xslt code snippet that claims to perform what I am looking for, but I don't know how I would run an xslt on another xslt. Can anyone help?

Thanks a bunch!

 
Old July 19th, 2007, 03:21 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There's an example in my book that does this (XSLT, p537) and you can find the stylesheet as list-includes.xsl in the download files.

You can supply a stylesheet as input to a transformation in the same way as any other XML document. Why should it be any different?

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 19th, 2007, 03:50 PM
Registered User
 
Join Date: Jul 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot! I just got the book today and haven't had a chance to read through to that part yet.

I am assuming that passing a stylesheet as input would be like:

java -jar c:\saxon\saxon8.jar input.xsl list-includes.xsl

Does it matter if some of the paths are using entities? Will it display the absolute or relative paths? Unfortunately I can't try this out until I find out what we use as a processor on our unix system.

Thanks again for your help! :)

 
Old July 19th, 2007, 04:15 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Not sure what you mean by "using entities". Entity references are expanded by the XML parser and XSLT only gets to see the document after entity expansion.

The stylesheet as written displays the relative paths. It's essentially a 1.0 stylesheet, but if you're using a 2.0 processor you can get the absolute URIs by using the document-uri() function.



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance for <xsl:import> and <xsl:include> vikkiefd XSLT 2 April 16th, 2008 08:06 AM
xsl:include / import and tomcat amitda XSLT 2 April 17th, 2007 10:37 AM
call template from diff file? (import vs. include) mister_mister XSLT 5 January 31st, 2007 07:12 PM
xsl:include within include chuck123ie XSLT 1 January 5th, 2006 11:07 AM
xsl:import or xsl:include ShaileshShinde XSLT 2 August 17th, 2005 04:49 AM





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