>I have an XML input document where the default namespace is bound
>somewhere,...
>If I take the 'xmlns' binding off the input document, [my select of an
>unprefixed element name] works.
>Also,  if I use a prefix, and put the binding back on but using the
prefix,
>and bind that prefix in the xsl stylesheet, it works.
>Can anyone tell me why?

You have encountered a famous XPath FAQ. I think you can find some
explanation in Dave Pawson's XSLT FAQ website. The quick answer is
that select="mydoc" in XPath means non-namespaced "mydoc" elements.

>I  am  writing an application where I am expecting XML documents to be
>sent to me where the default namespace will be bound,...

If that namespace is known and unvarying, use a namespace prefix in
your stylesheet. If you can't be sure about the namespace, there are
a few tricks possible, but you need to review the overall design.
.................David Marston


Reply via email to