Hi Alan,

 

My own experiments with HTML5 as a container for SVG persuade me that it's
not quite ready for prime time yet. HTML5 has some good ideas but hasn't yet
quite congealed I think. If I want the few goodies that HTML has to offer
that SVG doesn't yet (flowing text and tables), then I tend nowadays to use
<object> (or <embed> if IE6-8 support is important), with a separate SVG
document. The inline stuff is just too inconsistent across browsers, and
ideological objections to SVG from among the HTML5 cowboys are
well-established, so it may requiring either waiting a spell or casting one
'til consistency is achieved. 

 

The little experiment at http://granite.sru.edu/~ddailey/svg/svginHTML.html
shows some DOM methods working somewhat consistently across browsers I
think.

 

See also http://lists.w3.org/Archives/Public/www-svg/2011Sep/0087.html and
the follow on for some allied discussion.

 

Doug Schepers offers the following explanation about setAttributeNS and
setAttribute:

http://tech.groups.yahoo.com/group/svg-developers/message/64106

 

I think the simple explanation is that the latter should work in the context
of the SVG document alone; Doug recommends using getAttributeNS in the
context of xlink:href, but I'm not quite sure how that translates into the
still evolving world of HTML5.

 

Other folks may have had better luck with HTML5 and SVG and may well have
other answers, but my experiments suggest hesitation is prudent.

 

Cheers

David

From: [email protected] [mailto:[email protected]]
On Behalf Of krugerboy1971
Sent: Tuesday, March 13, 2012 5:01 PM
To: [email protected]
Subject: [svg-developers] Re: ie9 and foreign namespace attributes

 

  

The plot thickens - i.e. this seems nuts - even with David's Doctype
suggestion, I can't determine a cross-browser method of retrieving an
attribute with a foreign namespace. IE9 seems to use a DOM1 method(1),
safari/ff work with a method that I wouldn't expect to work (2) while the
method that seems to be endorsed officially
(3)(http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#getAttribute)
doesn't seem to work in any of them.

Am I missing something obvious?

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<script>
function doCircle(evt) 
{
var theCircle = evt.target;
var myName=theCircle.getAttribute("fme:COUNT");//1-works in ie9, not ff or
safari
//var myName = theCircle.getAttributeNS(null,"fme:COUNT");//2-works in
safari,ff,but not ie9
//var myName =
theCircle.getAttributeNS("http://www.safe.com","fme:COUNT";);//3-works in
nothing
alert(myName);
}
</script>
</head>
<body>
<svg width="300px" height="300px" xmlns:fme="http://www.safe.com";>
<text x="25" y="50" font-size="24">SVG Circle Element</text>
<text x="25" y="275">Click the circle to change its size.</text>
<circle cx="125" fme:COUNT="20" cy="150" r="50" fill="pink" stroke="green"
stroke-width="5" onclick="doCircle(evt)" />
</svg>
</body>
</html>





[Non-text portions of this message have been removed]



------------------------------------

-----
To unsubscribe send a message to: [email protected]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
----Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to