Re: O:XML and firefox 1.5 SVG
Martin Klang <[email protected]> Mon, 30 Jan 2006 17:40:40 +0000
| Newsgroups | gmane.text.xml.o-xml |
|---|---|
| Message-ID | <[email protected]> |
Hey,
sorry for the delay in replying -
I tried using one of the shorter examples (Style 1) as a base and did
this:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<o:program xmlns:o="http://www.o-xml.org/lang/" content-type="text/xml">
<html:html xmlns:html="http://www.w3.org/1999/xhtml">
<html:head>
<html:script type="text/javascript">
function change_style(style_string)
{
document.getElementById("circ100").setAttribute("style",
style_string);
}
</html:script>
</html:head>
<html:body>
<html:button onclick="change_style('fill:red;');">red</html:button>
<html:button onclick="change_style('fill:blue;');">blue</
html:button>
<svg:svg xmlns:svg="http://www.w3.org/2000/svg" height="200">
<o:for-each in="60 100 140 180">
<svg:circle cx="{.}" cy="100" r="1cm" id="circ{.}"
style="fill:red;"/>
</o:for-each>
</svg:svg>
</html:body>
</html:html>
</o:program>
It contains a simple loop to create several circles, instead of the one.
Note that FireFox will only honour the SVG content if the output is
saved with a .xml suffix.
The original example was using default namespace declarations for
html and svg.
If you try that with the current version of ObjectBox you'll notice
that, unfortunately, it doesn't work! There's a bug in the stream
serialising code that wrongly outputs default namespace declarations
as xmlns:xmlns="...".
I've fixed the bug and an updated version will be out soon.
In vendue, the output is generally transformed by an xslt to html. It
seems that Firefox will only accept the SVG if it's in xml content,
so don't specify an html stylesheet PI in these programs (the above
example saved as svg-html.oml works fine).
best regards,
/m
On 28 Dec 2005, at 9:40, John Cobo wrote:
> Hi,
>
> I note that Firefox browser v. 1.5 contains native
> support for SVG -
> http://www.croczilla.com/svg/samples/ .
>
> Can someone how to run something like one of the
> 'compound document' exmaples (svg within html such as
> the 'DOM1' example) within a vendue like structure ?
> I can not seem to get the namespaces correct.
>
> Thanks,
>
> John C.
>