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

Re: Expanding QNames in ElementExpressions and AttributeExpr

Subject: Re: Expanding QNames in ElementExpressions and AttributeExpressions?
From: James Clark <jjc@xxxxxxxxxx>
Date: Wed, 03 Feb 1999 17:45:43 +0700
clark qname
Tyler Baker wrote:
> 
> "When comparing the name of an element to a QName, the QName is expanded
> into a local name and a possibly null URI. This expansion is done in the
> same way as for element type names in start and end-tags except that the
> default namespace declared with xmlns is not used: if the QName does not
> have a prefix, then the URI is null (this is the same way attribute
> names are expanded). The expanded element type names are compared (see
> Section 2.4.2: Element Nodes)."
> 
> This is not clear to me how the QNames for ElementExpressions and
> AttributeExpressions are expanded.  In other words, what is the context
> to use for resolving the namespace of an ElementExpression or
> AttributeExpression QName.
> 
> Is the context the stylesheet document?  In this case for a template
> match expression would the namespace be the current namespace of the
> template element for the given prefix.

Yes.  The context is the element in the stylesheet document in which the
pattern occurs. I'll add something to clarify this.

> Or is the context the current node in the source tree.  In this case for
> a template match expression would the namespace be the current namespace
> of the current node for the given prefix.
> 
> In other words for:
> 
> <xsl:template xmlns:foo="http://www.foo.com" match="foo:bar">
> </xsl:template>
> 
> When matching an element node that belongs to the namespace
> "http://www.baz.org", does the previous template match expression get
> resolved to

> <xsl:template xmlns:foo="http://www.foo.com"
> match="{http://www.foo.com}bar">
> </xsl:template>
> 
> or else:
> 
> <xsl:template xmlns:foo="http://www.foo.com"
> match="{http://www.baz.org}bar">
> </xsl:template>

The former.

James



 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.