Subject: XSL + Namespace Question
From: David Rosenborg <David.Rosenborg@xxxxxxx>
Date: Mon, 24 Aug 1998 13:11:55 +0100
|
Hi!
I've a question about the semantics of namespaces in XSL. The
answer is probably in the WD, but it wasn't obvious to
me after a first look. The WD states that element and
attributes names are compared in their expanded form.
My question is about how they get expanded.
Q: What is the namespace of names used in matches and selections?
More specific: What is the namespace of attribute names?
Imagine the following input data snippet:
<baz>
<abc:foo xmlns:abc="mailto:x@xxxxx" bar="Some value"/>
</baz>
Which of the following will select the bar attribute of abc:foo?
Assuming baz is the current element
1. <xsl:value-of
xmlns:abc="mailto:x@xxxxx"
expr="abc:foo/attribute(bar)"
>
2. <xsl:value-of
xmlns:abc="mailto:x@xxxxx"
expr="abc:foo/attribute(abc:bar)"
>
Assuming abc:foo is the current element
3. <xsl:value-of
expr="attribute(bar)"
>
4. <xsl:value-of
xmlns:abc="mailto:x@xxxxx"
expr="attribute(abc:bar)"
>
My guess is that the answer is 2 and 4. Alternative 1 would
also be a logic choice, considering how unqualified attributes
normally are in the same namespace as their parent element.
Cheers,
</David>
_____________________________________________________________________
David.Rosenborg@xxxxxxx OM Exchange Technology
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|