- From: Jeff Schiller <codedread@gmail.com>
- Date: Thu, 30 Nov 2006 22:45:47 -0600
- To: www-svg@w3.org
- Cc: adam@emiasys.com
Also, I guess I should have mentioned (in case it wasn't obvious) that every Node has a ownerDocument attribute, which would get you to the Document object of that Node from which you could do getElementById(). Regards, Jeff On 11/30/06, Jeff Schiller <codedread@gmail.com> wrote: > > Hi! > > > > What should be the scope of: > > > > - getElementById() - SVG NS or all? > > > > If not all, how to get elements by id outside of the svg namespace? > > > > Regards > > > > Alexander Adam > > -- > > Geschäftsführer / CEO > > As per http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-getElBId, > this method is part of the Document interface. Thus, this gives you > the child element of the Document object (i.e. the child within that > DOM). If you want to get elements outside of the Document, then > you'll have to navigate to another Document Object Model. This is > generally possible. > > Read this article, > http://dev.opera.com/articles/view/svg-evolution-not-revolution/ > > Specifically on Page 2, I get into how to navigate between DOMs in the > case of HTML and SVG integrated with the HTML:object entity. I even > drew some pretty diagrams (in SVG, of course!). > > In the case of XHTML containing inline SVG nodes, then you would go > from the SVGDocument up to the parent Node in the HTML DOM: > > - SVGDocument (http://www.w3.org/TR/SVG11/idl.html) inherits from Document > - Document (http://www.w3.org/TR/DOM-Level-2-Core/core.html#i-Document) > inherits from Node > - Node (http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247) > has a parentNode attribute > > Once you've navigated to the other DOM, then you'd use > getElementById() method on the Document entity in that DOM. > > Hope this clues you in. > > Thanks, > Jeff >
Received on Friday, 1 December 2006 04:46:04 UTC