I'm fairly new to XSLT and XPath. My question is related to some posts
I found in group archives (e.g. "Disable XPath namespace matching in
XSL") but is a little more specific.
I want a single XSLT document to be able to process a documents in a
defined format which may or may not have its namespace delcared.
I know how to process either form of an element using
<xsl:apply-templates select="*[local-name() = 'my-root']"/>
or
<xsl:apply-templates select="my-root | pref:my-root"/>
The problem is that even with these statements it appears I still need
two separate mathing templates:
<xsl:template match="my-root>
...
<xsl-template match="pref:my-root">
...
I can get to a single template by calling the same match template from
each of the named templates above. However, with several dozen types
of elements to process, this becomes very tedious!
Does anyone have a better way? Specifically is there a way to just
make the entire XSLT disregard or strip a specific namespace, or else a
way to make apply-templates match either form and then call a named
template?
TIA,
Chris