Subject: RE: a very unusual namespace question
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Mon, 21 May 2001 09:30:49 +0100
|
> I have a stylesheet A that is outputting stylesheet B (using
> xsl:namespace-alias'ing). Stylesheet B will be matching elements from
> namespace N so it must have a namespace declaration for N.
> But the problem
> is that namespace N is not known at the time I construct A
> and does not
> appear in the input to A. I would like to pass the prefix
> and URI for N to
> stylesheet A as top-level parameters. How can I get stylesheet A to
> generate a namespace declaration in B from the parameters?
As Jeni pointed out, you can generate a namespace declaration in the output
document by generating a dummy attribute that uses that namespace.
Fortunately your target document is a stylesheet, and stylesheets allow
dummy attributes to appear on any xsl element provided they are
namespace-qualified. (But don't put it on a literal result element!).
There's no way currently of generating a free-standing namespace declaration
in the output document, though if the processor implements the errata to
XSLT 1.0 then you can copy a namespace node from any source document using
<xsl:copy>.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|