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 May 19th, 2008, 03:31 PM
Authorized User
 
Join Date: Jan 2008
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to centralize namespace path?

I have a lot of xslt files that I use and they each share the same namespace path. This namespace path is subject to change and it would really nice if I could place it in some other file and then include that file into my style sheets, so I only have to change on file.

Is this possible in xslt? It's a simple programming concept, but I can't find any information on it. Any help is appreciated, thanks!

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

XSLT relies on XML facilities to declare namespaces, and XML doesn't provide any capability like this: it deliberately makes namespace declarations local to a document.

Some people put namespace declarations in a DTD as default attribute values, which are then implicitly added to every document using that DTD. It works, but I think it's a really bad idea - people reading and editing the documents can't see what's going on.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 20th, 2008, 01:14 PM
Authorized User
 
Join Date: Jan 2008
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Damn :( Is it possible to import other xslt documents into each other, reusing similar chunks of code? Thanks in advance

 
Old May 20th, 2008, 01:21 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Take a look at xsl:include and xsl:import.

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
how to centralize a SSTAB in a form Andraw Pro VB 6 1 October 27th, 2008 12:56 PM
Need Help with path for loading Pics (app.path) Tabbasum Beginning VB 6 2 November 15th, 2007 04:57 AM
Implementing the all-path shortest path problem bitwords XSLT 1 December 6th, 2006 11:37 AM
using app.path in database path and filename kd8con VB Databases Basics 2 October 25th, 2006 11:45 AM
Convert logical path to absolute path zoostar J2EE 1 April 15th, 2005 10:36 AM





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