RE: exclude-result-prefixes Editors please note:

Subject: RE: exclude-result-prefixes Editors please note:
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Wed, 8 Mar 2000 14:56:37 -0000
David Carlisle wrote:

>But that means that namespace declaration is in scope for the entire
>stylesheet and so in particular it is in scope on every literal result
>element
>so 
><xsl:template match="h:a[@name]">
>  <anchor id="{@name}"/>
>  <xsl:apply-templates/>
></xsl:template>
>
>would produce
>
><anchor id="xxx" xmlns:h="http://www.w3.org/1999/xhtml"/>
>
>in the output or maybe not but xmlns:h="http://www.w3.org/1999/xhtml
>would appear on _some_ ancestor of this anchor element in the output,
>becaue it is on some ancestor of anchor in the stylesheet.
>
>This probably is not what you want so you can tell the system that some
>namespaces are just for use within the stylesheet, or for querying the
>input document. the XSL namespace automaticaly has that status, to add
>others you use exclude-result-prefixes="h"
>
>then since the anchor element isn't in the xhtml namespace, and neither
>are any of its attributes or children, the
>xmlns:h="http://www.w3.org/1999/xhtml";
>does not appear in the output, which is a good thing if you want to
>validate the output against (in this case) the docbook dtd.

I *think* thats what I was trying to summarise...
The end result being, if thats what the stylesheet author wanted,
that no namespaces are produced in the output for the 
namespaces named in exclude-result-prefixes="xxx" list.


The key phrase there for me is
you can tell the system that some
namespaces are just for use within the stylesheet, or for querying the
input document. 

I'll try and put an example together for the faq.

Thanks to Ken and David for an instructive session.

Regards, DaveP


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread