Re: dynamically create and insert SVG into an HTML page

Justin Friedl wrote:
> 
> thanks, how? Because I can't figure out how to take dynamically created SVG
> and insert it into an <embed> tag in HTML.  I want to just take the unparsed
> SVG-XML data and insert somehow into an <embed> tag.  The only way I can
> figure out how to insert SVG is through a "src" attribute of <embed> which
> references a .svg file. 

Correct.

> This is ok but does not solve the problem of
> dynamically creating an entirely new SVG-XML image on the client.

Also correct. It would be better to do it inline.

> Here's my scenario:
> XML is downloaded to the client(browser IE 5.0/5.5) 

presumably any XML browser ;-)

> along with several XSLT
> transformation stylesheets (for different views of the data). 

OK, any XML + XSL-T browser

>  On the client
> one stylesheet is applied(through javascript in an HTML page)

Where did the HTML page come from?

> to the XML
> data(using MSXML3).  The output of this is SVG-XML data.  The SVG-XML data
> is then displayed.  The user can click on different views in which case
> different XSLT stylesheets are applied to the original XML and new SVG-XML
> is output to be viewed.

OK. The weak link here is the traditional, not necessarily well-formed,
HTML. Using XML (for example, XHTML) you can then have the SVG as child
elements in a single XML parse tree. For that you need an XML browser that
can render SVG (for the graphics) and can render text using CSS or XSL FO
(for the text).

--
Chris

Received on Friday, 23 June 2000 09:18:16 UTC