[xsl] Empty xmlns attribute being generated

Subject: [xsl] Empty xmlns attribute being generated
From: Mark Anderson <mark.anderson@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Jan 2010 09:27:43 +0000
Hi All

I'm using XSLT1.0 and Saxon 6.5.5 (in Oxygen). I'm, transforming XML to XSL-FO
to PDF. The XSL transform contains SVG.

Basically, I need to create an SVG element and then call a template several
times. Each call will draw a rectangle. The problem is the <rect> element in
resulting SVG has an empty xlmns element in it. See line 4 of the result

Here's a snippet from my source XSL
<fo:block>
<fo:flow flow-name="xsl-region-body">
          <fo:block>
            <fo:instream-foreign-object content-height="100">
              <svg width="400" height="100" version="1.1"
xmlns="http://www.w3.org/2000/svg";>
              <xsl:call-template name="draw_page2">
                <xsl:with-param name="pos_across" select="1"/>
              </xsl:call-template>
              <xsl:call-template name="draw_page2">
                <xsl:with-param name="pos_across" select="2"/>
              </xsl:call-template>
              </svg>
     </fo:instream-foreign-object>
</fo:block>

Here's the template it's calling:
<xsl:template name="draw_page2">
    <xsl:param name="width" select="70"/>
    <xsl:param name="height" select="100"/>
    <xsl:param name="pos_across" select="1"/>
    <!-- Page area -->
    <rect x="{($width * $pos_across) - $width}" y="0" width="{$width}"
height="{$height}" style="stroke-width:1; fill:rgb(255,0,0);
stroke:rgb(10,10,10)"/>
</xsl:template>

Here's the result:
<fo:block>
            <fo:instream-foreign-object content-height="100">
               <svg xmlns="http://www.w3.org/2000/svg"; width="400"
height="100" version="1.1">
                  <rect xmlns="" x="0" y="0" width="70" height="100"
style="stroke-width:1; fill:rgb(255,0,0); stroke:rgb(10,10,10)"/>
                  <rect xmlns="" x="70" y="0" width="70" height="100"
style="stroke-width:1; fill:rgb(255,0,0); stroke:rgb(10,10,10)"/>
               </svg>
            </fo:instream-foreign-object>
</fo:block>

Can anyone tell me what problem is?

M a r k

Current Thread