[xsl] default namespace in xsl and xpath expressions

Subject: [xsl] default namespace in xsl and xpath expressions
From: "stefan krause" <stefan.krause@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Jul 2004 18:12:18 +0200
Dear all,

There's something I haven't understood quite (warning: this is a
namespace newbie question), so I'm calling for a patient list member to
answer the following question:

I have an xml document with an schema and a xsl style sheet.
Of course any Xpath expressions will not yield the result I wanted if I
don't add the namespace qualifier.
[Example: document looks like ... <document xmlns="mynamespace"> ...,
Xpath expression tries to select "/document" and returns no nodes]

But why doesn't it work when I set the default namespace to the
document's namespace and try to use Xpath expressions in XSL without
namespace qualifiers?
[Example: document looks like ... <document xmlns="mynamespace"> ...,
XSL looks like ... <xsl:template match="/" xmlns="mynamespace">
and Xpath expression is the same as above]

Thanks for all answers,

Current Thread