Re: [xsl] Generating namespace declarations in output documents: How?

Subject: Re: [xsl] Generating namespace declarations in output documents: How?
From: David Moles <david.moles@xxxxxxxxx>
Date: Thu, 06 Sep 2001 08:17:24 -0700
Jarno.Elovirta@xxxxxxxxx wrote:


So what *will* result in a namespace declaration being output?



Let the XSLT engine worry about outputing the namespace declarations - just do

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
               xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance";
               version="1.0">
   <xsl:template match="foo">
     <xsl:element name="bar">
     <xsl:attribute name="xsi:noNamespaceSchemaLocation">
       [somewhere]
     </xsl:attribute>
     </xsl:element>
     <xsl:apply-templates/>
   </xsl:template>
</xsl:transform>

Hey, it works! Thanks! I knew I was making it more complicated than it had to be.

--D


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread