get path elements

Raghu
02-17-2005, 08:06 AM
Hi,
In following snippet I need to access the attribute of path element. Please
provide a solution.

<g id="objid-1509-1867"><desc>ParisObject</desc>
<g id="comp-1509-2223-1868">
<g style="stroke:rgb(0,240,0);stroke-dasharray:none;stroke-width:100;fill:none;fill-opacity:0">
<path d="M 212747656,-190398966 L 212721062,-190451692 L 212437743,-190301694 L 212430133,-190282952 L 212258060,-190192589"/>
</g>
</g>
<desc>range:212258060:-190192589:212747656:-190451692</desc>
</g>

Raghu :cry:

Anonymous
02-17-2005, 10:49 AM
your path is
svgDocument.getElementById("comp-1509-2223-1868").firstChild.nextSibling.firstChild.nextSibling

But if you remove linefeed in your code, it's no more true ....

To get d attribute
svgDocument.getElementById("comp-1509-2223-1868").firstChild.nextSibling.firstChild.nextSibling.ge tAttribute("d")

Michel

Raghu
02-18-2005, 12:09 AM
Hi,
Thanks for your solutions. I am also find another solution for this problem. For your information I provide below

groupParent=svgContentsDocument.getElementById("comp-1509-2223-2492");
var pathNodes = groupParent.getElementsByTagName('path');
var path = pathNodes.item(0);
var pathData = path.getAttribute('d')
:lol:

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum