Use of SVG in XHTML doc with use of namespace declaration

Kavitha
07-11-2005, 12:24 AM
hi friends,

There are three ways of defining SVG in a Web document:
1.as a standalone SVG page
2. as an embedded element
3.in an XHTML document with a namespace declaration

Can anyone send an example of the third way of using SVG's and I heard that the third way is the most efficient when compared to the above two . what's the reason?

Any plugins extra needed to run the XHTML doc with namespace declaration...


Please Clarify me...
Kavitha.

Anonymous
07-11-2005, 03:26 AM
This example run in Mozilla with SVG buid in it
( give xml as extension to your file ... )
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" >
<body>
<svg:svg>
<svg:g style="fill-opacity:0.3;">
<svg:circle cx="6cm" cy="2cm" r="100" style="fill:red; stroke:none; stroke-width:0.01cm" transform="translate(0,50)" />
<svg:circle cx="6cm" cy="2cm" r="100" style="fill:blue; stroke:none; stroke-width:0.01cm" transform="translate(70,150)" />
<svg:circle cx="6cm" cy="2cm" r="100" style="fill:green; stroke:none; stroke-width:0.01cm" transform="translate(-70,150)"/>
</svg:g>
</svg:svg>
</body>
</html>

If you want to use IE, with ASV6 beta you have to add to code
<object id="AdobeSVG"
CLASSID="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2">
</object>
<?import namespace="svg" implementation="#AdobeSVG"?>
but
for IE with Adobe plugin, it's not the solution ...

Michel

Kavitha
07-11-2005, 03:42 AM
hi michel,
I am working in IE6.0 with Adobe SVG viewer.
The below code try.xml is not displaying svg images. It's simply showing xml tags in the browser. what should I do inorder to display images of SVG?

<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" >
<body>
<object id="AdobeSVG"
CLASSID="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2">
</object>
<?import namespace="svg" implementation="#AdobeSVG"?>
<svg:svg>
<svg:g style="fill-opacity:0.3;">
<svg:circle cx="6cm" cy="2cm" r="100" style="fill:red; stroke:none; stroke-width:0.01cm" transform="translate(0,50)" />
<svg:circle cx="6cm" cy="2cm" r="100" style="fill:blue; stroke:none; stroke-width:0.01cm" transform="translate(70,150)" />
<svg:circle cx="6cm" cy="2cm" r="100" style="fill:green; stroke:none; stroke-width:0.01cm" transform="translate(-70,150)"/>
</svg:g>
</svg:svg>
</body>
</html>

Thanks
Kavitha

Julia
07-11-2005, 04:11 AM
Which one is the best way of implementing SVG of the above 3 methods?
and the reason for it...
Thanks,
Julia

Anonymous
07-11-2005, 07:56 AM
I am working in IE6.0 with Adobe SVG viewer.
The below code try.xml is not displaying svg images. It's simply showing xml tags in the browser. what should I do inorder to display images of SVG?

In IE, name your file try.htm and this will run with Adobe SVG Viewer VERSION 6 BETA only.

Michel

Anonymous
07-11-2005, 08:02 AM
Which one is the best way of implementing SVG of the above 3 methods?
and the reason for it...

All depend of your browser ...
For IE with ASV3 or 6 you can use embed tag in HTML or SVG standalone ( don't forget mime type on your server )
If you don't want to reinvent the wheel by creating widgets in standalone svg, you can use HTML forms to interact with your embedded svg.
With IE + ASV6 beta, you can have some communication problems html <-> svg

For Mozilla, svg fragment with namespace in xml file seem better and more natural.

Michel

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum