xsl-list
[Top] [All Lists]

How do I display an SVG file using XSLT?

2002-11-21 11:51:43
The SVG file already exists so I reference it in the XML file as:

      <image NAME="images/svg_test.svg" WIDTH="219" HEIGHT="174" />

How do I get the file 'svg_test.svg' to display in an HTML page using XSLT?
What I need to see on the HTML side is:

<object data="images/svg_test.svg" width="219" height="174"
type="image/svg+xml"></object>

This is the section of the XSLT i'm trying to use:

<xsl:template match="image">
            <xsl:element name="object">
               <xsl:attribute name="data">
                  <xsl:value-of select="@NAME" />
               </xsl:attribute>

               <xsl:attribute name="width">
                  <xsl:value-of select="@WIDTH" />
               </xsl:attribute>

               <xsl:attribute name="height">
                  <xsl:value-of select="@HEIGHT" />
               </xsl:attribute>

               <xsl:attribute name="type">
                  <xsl:value-of select="image/svg+xml" />
               </xsl:attribute>
            </xsl:element>
</xsl:template>



The result is that I get an area of the size described in the XML on the
HTML page but with nothing in it.

Thanks,
Mark G.



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



<Prev in Thread] Current Thread [Next in Thread>