This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Namespaces and For-each
- To: xsl-list at mulberrytech dot com
- Subject: Re: Namespaces and For-each
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Thu, 24 Feb 2000 17:21:47 GMT
- References: <000601bf7ee8$2d4c97d0$cce7bd9d@softwareag.co.uk>
- Reply-To: xsl-list at mulberrytech dot com
> Can anyone tell me if this is to be expected?
no it's not. as it sounds like it should work.
However if I ignore
> In contrast, if I have a series of
> templates matching "/", "*" and "my-element" with each of the doing an
> apply-templates, I *do* select the "my-element".
I could answer the more usuaal usual quaestion as to why //my-element
might not select an element named my-element. In the hope that
perhaps you lied:-)
You said:
> I am trying to transform a document which uses several namespace
> prefixes.
but whether it uses many (or even no) prefixes is not the point, the
point is how many namespaces does it use, and in particular what
namespace is my-element in.
If your document has used xmlns="xxx" somewhere so that my-element is
in the namespace xxx then
<xsl:for-each select="//my-element">
will not match it, you need so do xmlns:x="xxx" in the stylesheet
and use "//x:my-element"
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list