This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: implements-prefix vs implements-namespace
- To: DPawson at rnib dot org dot uk
- Subject: Re: [xsl] implements-prefix vs implements-namespace
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Tue, 6 Mar 2001 13:22:40 +0000
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <9B66BBD37D5DD411B8CE00508B69700F4F0393@pborolocal.rnib.org.uk>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Dave,
> I've created a stylsheet from some other source, which has the
> correct xsl namespace, but uses out: as prefix.
>
> If I import/include this into a main stylesheet which uses xsl: as
> the prefix, what happens?
What should happen is that the imported stylesheet is used in the same
way whatever the prefix. Within the main stylesheet, you have XSLT
instructions that are declared with elements in the XSLT namespace as
indicated by an 'xsl' prefix. Within the imported stylesheet, you have
XSLT instructions that are declared with elements in the XSLT
namespace as indicated by an 'out' prefix. It should make no
difference to the processor what prefix is used in the imported
stylesheet. All it needs to do is recognise which are XSLT
instructions, which are literal result elements and which are
extension elements.
If you try to use an element in the main stylesheet using the 'out'
prefix then (unless you have namespace declaration that uses the 'out'
prefix in the main stylesheet) you will be shouted at by your XSLT
processor because it doesn't understand what namespace the 'out'
prefix indicates - you haven't declared that prefix for any namespace
in that document. The same thing will happen if you have an element
with an 'xsl' prefix in the imported stylesheet, again unless you have
a namespace declaration that uses the 'xsl' prefix within it.
The bottom line is that a namespace declaration's scope is limited to
the literal content of the element that it's declared on and the
element itself. Namespace declarations for a particular element cannot
be introduced from other documents in any way.
Is that any clearer?
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list