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

RE: Namespaces in XSLT

Subject: RE: Namespaces in XSLT
From: "Evan Lenz" <evan@xxxxxxxxxxxx>
Date: Sat, 4 May 2002 19:51:07 -0700
xsl local uri
tinku wrote:
>    Is the default namespaces taken into account when processing
> XPATHs in an XSL stylesheet? What will be generated as the
> following is given:

I think you might be asking two different questions here:

1) Is the default namespace taken into account when evaluating XPath
expressions (or match patterns) in an XSLT stylesheet?

2) Is the default namespace taken into account when creating an element with
a literal result element?

The answer to #1 is no. Looking at your example:

> <xsl:template xmlns= "http://foo.com" match='bo[@xpath]'>
>        <foo/>
> </xsl:template>

This template rule will only match "bo" elements that are not in a
namespace. If you want to match (or select) "bo" elements in a namespace,
you must use a prefix and corresponding xmlns declaration.

Note that, for the sake of convenience, XSLT 2.0 will provide a way to
declare a default namespace for XPath expressions and XSLT patterns, in the
form of an [xsl:]default-xpath-namespace attribute. See
http://www.w3.org/TR/xslt20/#unprefixed-qnames

The answer to #2 is yes. More accurately, the XSLT processor just takes the
local/URI pair that the namespace-aware XML parser gives to it. In your
example above, the <foo/> element name consists of the following local/URI
pair: ("foo", "http://foo.com"). That is the name given to the created
element in the result tree.

Hope this helps,
Evan


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


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-2013 All Rights Reserved.