SVG + DOM + JS is pretty much the same like HTML + DOM + JS

> 1) How does an XML parser distinguish between SVG and Javascript

usually, Javascript is in a CDATA block. The content of a CDATA block 
is ignored by the XML parser. Also the content of the CDATA block 
does not need to be wellformed.

> 2) Does Javascript elemnt have a seperate DOM tree and SVG elements 
> have a separate DOM tree.

There is no DOM tree for Javascript. The content of a Javascript 
block is interpreted by an ECMAScript interpreter. Javascript is an 
object oriented language. Once the ECMAScript code is interpreted, 
you can access methods and properties of the objects in use.

The DOM is a theoretically language independent interface between the 
document tree (XML, HTML or SVG, or something else), however, in 
practice it is optimized for ECMAScript. The DOM provides interfaces 
for ECMAScript to access nodes, create nodes, delete nodes, reorder 
nodes, change attrihbutes of nodes, etc.

Hope this helps a little bit. There is a small tutorial on the DOM 
and ECMAScript at http://www.carto.net/papers/svg/
manipulating_svg_with_dom_ecmascript/index.shtml and one for events 
at http://www.carto.net/papers/svg/eventhandling/index.shtml.

I also found http://phrogz.net/ObjJob/objects.asp?langID=1 useful to 
see all methods and properties of objects in the SVG DOM, including 
inherited ones.

Andreas



-----
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:
    mailto:[EMAIL PROTECTED] 
    mailto:[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