Subject: RE: [xsl] adding a namespace to a stylesheet automatically From: Americo Albuquerque <melinor@xxxxxxxx> Date: Wed, 29 Oct 2003 14:17:09 -0000 |
Hi > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Lars Huttar > Sent: Wednesday, October 29, 2003 12:05 AM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: RE: [xsl] adding a namespace to a stylesheet automatically > > > > This is of course the scenario that motivated > > xpath-default-namespace in > > XSLT 2.0. > > > > Michael Kay > > Yes. I'm wondering if anyone has written a solution to make > do for XSLT 1.0. You can use local-name() ans namespace-uri() <xsl:template match="*[local-name()='foo' and namespace-uri()=$mynamespace]"> <xsl:if test="parent::*[local-name()='bar' and namespace-uri()=$mynamespace][@baz] = /*/*[local-name()='squid' and namespace-uri()=$mynamespace]">...</xsl:if> Just define $mynamespace as a global parameter. Every time you change namespaces you only need ta pass the new one to the stylesheet (...) Regards, Americo Albuquerque XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] adding a namespace to a s, Lars Huttar | Thread | RE: [xsl] adding a namespace to a s, Lars Huttar |
Re: [xsl] Making XPath expressions , Richard Lewis | Date | [xsl] Finding topmost element of a , Liguori, Steven |
Month |