This works just fine as long as the XML file has no default namespace.
However, when it does, the template does not populate the list.
I've not been able to find a solution to this, but it seems so obvious
that someone else must have run into it. I did see a similar question
posted but that was over 12 months back, and there was no reply.
Anyone got any ideas?
Realize that <element> and <ns::element> are two distinct element names, no more related to each other than <foo> and <bar>. I don't mean the exact lexical appearance - if <element> is associated with a namespace via defalut namespace declaration, that's still distinct from <element> associated with a different namespace, or no namespace at all. Similarly, <ns1:element> and <ns2:element> may actually denote the same element name, if ns1 and ns2 prefixes are bound to the same URI.
XML templates use XPath to interrogate XML file, and XPath is namespace-aware. If you want to match an element in a particular namespace, you have to bind a prefix for this namespace's URI and use it in your XPath expressions. If you want to match all elements with a given local name regardless of what namespace they are in, you can do it like this: "*[local-name()='element']"
Igor Tandetnik