[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: exclude-result-prefixes required in each imported

Subject: RE: exclude-result-prefixes required in each imported stylesheet
From: "Colin Adams" <colinpauladams@xxxxxxxxxxx>
Date: Mon, 18 Sep 2006 17:13:25 +0100
RE:  exclude-result-prefixes required in each imported
You set it for each individual stylesheet module.

This means that the source text can be understand in terms of itself, plus any texts it depends upon (via xsl:include or xsl:import).

If instead, the importing modules settings were used, then you would need to read the set of all modules that depend upon the txt you are reading - a potentially unbounded set - many of it's members might not yet be written.

So this would be a very bad software engineering practice. Fortunately, the XSLT designers didn't do it that way.

From: "andrew welch" <andrew.j.welch@xxxxxxxxx>

It seems exclude-result-prefixes needs to be explicity set for each
imported stylesheet, rather than using the value in the importing
stylesheet - is that right?

For example:

<xsl:stylesheet version="2.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
 exclude-result-prefixes="xs">

<xsl:import href="b.xslt"/>

<xsl:template match="/">
	<xsl:call-template name="foo"/>
</xsl:template>

</xsl:stylesheet>

b.xslt:

<xsl:stylesheet version="2.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xsl:template name="foo">
	<foo/>
</xsl:template>

</xsl:stylesheet>

The result is:

<foo xmlns:xs="http://www.w3.org/2001/XMLSchema" />

Is there any reason why the exclude-result-prefixes value isn't taken
from the importing stylesheet?  Not the biggest issue I know, just
struck me as odd.


_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters! http://www.msn.co.uk/newsletters


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.