Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Embedding SVG within XHTML

Reply
Thread Tools

Embedding SVG within XHTML

 
 
Raphael Goubet
Guest
Posts: n/a
 
      02-11-2004
Hi,

Is it possible to insert an SVG graphic directly in an XHTML file (ie,
not through a reference to an external file, but by directly placing
the SVG structure within the XHTML structure)?

How can I do it? Do I need to use a specific XHTML tag as a container
(such as for scripts) or a namespace?

Would a recent browser (such as IE 6 or Mozilla 1.6) properly display
the XHTML document with the SVG graphic?

Thanks in advance.

RaphaŽl

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      02-11-2004


Raphael Goubet wrote:

> Is it possible to insert an SVG graphic directly in an XHTML file (ie,
> not through a reference to an external file, but by directly placing
> the SVG structure within the XHTML structure)?
>
> How can I do it? Do I need to use a specific XHTML tag as a container
> (such as for scripts) or a namespace?


Yes, you can do that, and namespaces are the right way to do that.

> Would a recent browser (such as IE 6 or Mozilla 1.6) properly display
> the XHTML document with the SVG graphic?


Mozilla has built-in support for mixed namespace XHTML and MathML
document but not for SVG, however there are some specialized Mozilla
builds with some SVG support, see
http://ftp.mozilla.org/pub/mozilla.o.../latest-trunk/
and look for svg builds.

IE on Win also has its very own approach to an extension of HTML (not
XHTML) with namespaces where a plugin like Adobe SVG viewer then renders
the elements in the SVG namespace, so with IE/Win and Adobe SVG viewer
you can write HTML with inline SVG.
--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
 
Simon Stebbins
Guest
Posts: n/a
 
      02-25-2004
Raphael Goubet <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>. ..
> Hi,
>
> Is it possible to insert an SVG graphic directly in an XHTML file (ie,
> not through a reference to an external file, but by directly placing
> the SVG structure within the XHTML structure)?
>
> How can I do it? Do I need to use a specific XHTML tag as a container
> (such as for scripts) or a namespace?
>
> Would a recent browser (such as IE 6 or Mozilla 1.6) properly display
> the XHTML document with the SVG graphic?
>
> Thanks in advance.
>
> RaphaŽl


As far as I'm aware, it is not possible to do this yet in the major
browsers, however it is with Amaya. Amaya is W3C's browser/editor.
"The main motivation for developing Amaya was to provide a framework
that can integrate as many W3C technologies as possible." Since XHTML
and SVG are W3C recommendations the browser can view these
technologies. www.w3.org/Amaya

You might also want to check out these pages:
http://www.w3.org/TR/2002/WD-XHTMLpl...sSVG-20020430/
http://www.w3.org/TR/2002/WD-XHTMLpl...0/sample.xhtml

Simon
 
Reply With Quote
 
Thomas Meinike
Guest
Posts: n/a
 
      02-25-2004
Raphael Goubet wrote:

>Is it possible to insert an SVG graphic directly in an XHTML file (ie,
>not through a reference to an external file, but by directly placing
>the SVG structure within the XHTML structure)?


You can try this implementation with IE ans ASV:

<html xmlns:svg="http://www.w3.org/2000/svg">
<head>
<title>Inline-SVG</title>
</head>
<body>
<object id="AdobeSVG"
classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2"></object>
<?import namespace="svg" implementation="#AdobeSVG"?>
<svg:svg width="600" height="300">
<svg:text id="tx" x="20" y="55" style="font-size:
40px">SVG</svg:text>
<svg:rect id="re" x="135" y="20" width="40" height="40" style="fill:
#00C"/>
<svg:circle id="kr" cx="230" cy="40" r="20" style="fill: #F00"/>
<svgolygon id="po" points="280,60 300,20 320,60" style="fill:
#090"/>
</svg:svg>
</body>
</html>

cu, Thomas
--
SVG - Learning By Coding
<http://svglbc.datenverdrahten.de/>
 
Reply With Quote
 
Thomas Meinike
Guest
Posts: n/a
 
      02-25-2004
Raphael Goubet wrote:

>Is it possible to insert an SVG graphic directly in an XHTML file (ie,
>not through a reference to an external file, but by directly placing
>the SVG structure within the XHTML structure)?


You can try this implementation with IE and ASV:

<html xmlns:svg="http://www.w3.org/2000/svg">
<head>
<title>Inline-SVG</title>
</head>
<body>
<object id="AdobeSVG"
classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2"></object>
<?import namespace="svg" implementation="#AdobeSVG"?>
<svg:svg width="600" height="300">
<svg:text id="tx" x="20" y="55" style="font-size:
40px">SVG</svg:text>
<svg:rect id="re" x="135" y="20" width="40" height="40" style="fill:
#00C"/>
<svg:circle id="kr" cx="230" cy="40" r="20" style="fill: #F00"/>
<svgolygon id="po" points="280,60 300,20 320,60" style="fill:
#090"/>
</svg:svg>
</body>
</html>

cu, Thomas
 
Reply With Quote
 
Thomas Meinike
Guest
Posts: n/a
 
      02-25-2004
Raphael Goubet wrote:

>Is it possible to insert an SVG graphic directly in an XHTML file (ie,
>not through a reference to an external file, but by directly placing
>the SVG structure within the XHTML structure)?


You can try this implementation with IE and ASV:

<html xmlns:svg="http://www.w3.org/2000/svg">
<head>
<title>Inline-SVG</title>
</head>
<body>
<object id="AdobeSVG"
classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2"></object>
<?import namespace="svg" implementation="#AdobeSVG"?>
<svg:svg width="600" height="300">
<svg:text id="tx" x="20" y="55" style="font-size:
40px">SVG</svg:text>
<svg:rect id="re" x="135" y="20" width="40" height="40" style="fill:
#00C"/>
<svg:circle id="kr" cx="230" cy="40" r="20" style="fill: #F00"/>
<svgolygon id="po" points="280,60 300,20 320,60" style="fill:
#090"/>
</svg:svg>
</body>
</html>

cu, Thomas
--
SVG - Learning By Coding
<http://svglbc.datenverdrahten.de/>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax for a name in SVG within an XHTML document. peasthope@shaw.ca XML 2 10-22-2008 07:32 PM
[SVG] probleme dessin d'images SVG avec Batik Mardagg Java 0 05-12-2006 02:13 PM
[SVG] problem with SVG image drawing with Batik Library Mardagg Java 0 05-12-2006 02:12 PM
[SVG] using image-tag to integrate SVG in SVG Arne Nordmann XML 0 06-28-2004 01:16 PM
Embedding a CSS style sheet within a generated SVG file FC XML 4 10-01-2003 12:55 PM



Advertisments