This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Templates, Q Names and namespaces


In an XML document, I might have an element

<my:elem xmlns:my="http:myco.com">...</my:elem>

In a stylesheet, I can write something like:

<xsl:apply-templates select="my:elem"/>

<xsl:template match="my:elem">...</xsl:apply-templates>

Now, if I apply my stylesheet a new document containing:

<m:elem xmlns:m="http:myco.com">...</m:elem>

my stylesheet will no longer work. Equally, I could be using a default
namespace in the source document.

What is the simplest way to make my stylesheet independent of the prefix
used for the namespace, while keeping it correctly attached to the namespace
URI itself? And are there known XSL implementations where this doesn't work
(I know implementations of namespaces in some XSL implementations is rather
flaky).

Regards

Paul


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]