|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How do I display an SVG file using XSLT?
Forgetting for the moment the SVG issues, you're basically asking: How do I convert the element <image NAME="images/svg_test.svg" WIDTH="219" HEIGHT="174" /> into <object data="images/svg_test.svg" width="219" height="174" type="image/svg+xml"></object> ? Looking at your template... Here's your immediate problem. The value-of above implies that there exists in the xml the following structure: <image NAME="..." WIDTH="..." HEIGHT="..."> <image> <svg+xml>...</svg+xml> </image> </image> What you mean to say is <xsl:text>image/svg+xml</xsl:text> since that is the literal string that you wish to appear as the 'type' value. Your whole template above can be written as <xsl:template match="image"> <object type="image/svg+xml"> <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> </object> </xsl:template> As for what fills the resultant object in your browser after this conversion, that is up to your browser configuration / object installation / registry settings.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








