Re: [xsl] Namespace conflicts processing Word documents

Subject: Re: [xsl] Namespace conflicts processing Word documents
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 6 Oct 2008 14:30:10 +0100
> This makes it appear that namespaces cannot be inherited from an outer XSLT
> file to an included or imported one; in effect that the omission of
> namespace declarations on the included/imported xsl:stylesheet element
> nullifies all outer namespace declarations.
>
> Is this correct, or have I missed something?

No it's correct - namespaces operate at the XML level, not the XSLT
level.  I often get confused about that, and think that somehow import
precedence would allow you to do what you are trying to do, so you're
no alone.

To be honest, I'm not too sure things are correct as they stand now.
A prefix used in an XPath doesn't stop the XML from being namespace
well-formed, so I don't see why that namespace needs to be declared in
that particular file. It seems an artificial restriction.

To fix your problem, you could just define two different prefixes, say
"w" and "w2" for example (not for real)  and then modify all of your
stylesheets to handle both... not great I know.  Or if possible just
match on *.  Or alternatively do a 2 pass transform and convert the
input to use the other namespace, then process as normal.


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread