RE: XML to SVG... more info (A working version)

	Yes Andrew,
	if I run the SVG file converte by Instant Saxon, it works. But...
when I want an XML file to be converted, I just have to indicate the path to
the XSL and the conversion is automatic. If I install the SVG viewr from
Adobe... doesn't it realice this conversion without a third tool?
	Also... why can't I see a SVG file that I have stored with .xml
format is SVG has XML format and is supposed that I can introduce child SVG
code in a parent XML file?
	Can I insert a SVG image in an HTML page dinamically? I mean without
make the conversion in the server, doing it in the client using javascript

	thanks, Libo

> -----Original Message-----
> From: AndrewWatt2001@aol.com [mailto:AndrewWatt2001@aol.com]
> Sent: 24 August 2000 18:40
> To: www-svg@w3.org
> Cc: Libo.Torres@primark.com; RBoyet@aol.com
> Subject: Re: XML to SVG... more info (A working version)
> 
> 
> Hi again Rick & Libo,
> 
> I have taken Libo's code which he posted earlier and made some 
> corrections/changes. It now works for me - it produces the 
> text "Paco" in red 
> at the top left of the browser window with a black rectangle 
> below and to the 
> right.
> 
> I will post the XML file, XSLT transformation sheet and the 
> output SVG file 
> (from Instant Saxon). I guess you will be able to spot the 
> changes and see if 
> this code, which works for me, also works for you.
> 
> The XML file is:
> 
> <?xml version="1.0" ?>
>     <?xml-stylesheet href="convertsvg1.xsl" type="text/xsl"?>
> <Result>
>     <Name>"Paco"</Name>
> </Result>
> 
> The XSLT file is:
> 
> <?xml version="1.0"?>
> 
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> 
>   
> <xsl:output indent="yes" media-type="svg-xml" />
>   <xsl:strip-space elements="*"/>
> 
> <!-- Add DOCTYPE -->
> <xsl:template match="/">
> <!--
>     <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE svg PUBLIC
> "-//W3C//DTD SVG 20000802//EN" 
>       
> "http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd"&gt;
>     </xsl:text>
> -->    
>     <xsl:apply-templates/>
> </xsl:template>
> 
> <xsl:template match="Name">
>     <svg width="500" height="500">
>         <text x="0.5cm" y="0.5cm" style="font-family:Verdana;
> font-size:16pt; fill:red">       
>             <xsl:value-of select='.'/>   
>         </text>
>         <rect x="2cm" y="1cm" width="6cm" height="3cm"/>
>     </svg>
> </xsl:template>
> 
> </xsl:stylesheet>
> 
> The SVG file which Instant Saxon output was:
> 
> <?xml version="1.0" encoding="utf-8" ?><svg width="500" 
> height="500"><text 
> x="0.5cm" y="0.5cm" style="font-family:Verdana; 
> font-size:16pt; fill:red">"Pac
> o"</text><rect x="2cm" y="1cm" width="6cm" height="3cm"/></svg>
> 
> That SVG file displayed in IE5.5 as described above.
> 
> I hope that helps you both to get it working on your own systems.
> 
> Andrew Watt
> 

Received on Thursday, 24 August 2000 14:14:01 UTC