Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Tue, 1 Apr 2008 11:48:38 +0800,    group: microsoft.public.xml.soap        back       


xml node.childNodes.length   
<g id= "hostgrouptest" >
<rect  id= "host3" x="28%" y="42.2%" width="7%" height="10%"
fill="lightgray" stroke="black" stroke-width="1"  rx="5" ry="2"
onmouseover = "nodeovercommon(evt)"  onmousedown="nodetransformdown(evt)"
onmousemove="nodetransformmove(evt)" onmouseup = "nodetransformup(evt)" >
</rect>
<image id="server" x="28%" y="42.2%" width="15" height="20"
xlink:href="Server.png"/>

</g>

Code:

function  nodetransformmove(evt)
{ var
 thenode = evt.target.parentNode.getAttribute("id");
//µÃµ½¸¸½Úµã
var parentnode = evt.target.ownerDocument.getElementById(thenode);
alert("parentnode"+parentnode.childNodes.length);
         }
 why   parentnode.childNodes.length  is  5, I think  it should be 2, who can
explain for me?







-- 
Çë²éÊÕ£¬Ð»Ð»
-------------
ÁõÃ÷¹ó
date: Tue, 1 Apr 2008 11:48:38 +0800   author:   lmg

RE: xml node.childNodes.length   
hello Img,

pleae aleart all the childnodes so that you can come to know which all are 
the nodes.
one reason might be that parent node might be poininting to some other 
element other than <g></g>  

Please alert("parentnode"+parentnode.childNodes[0]) to childnodes[4]

Regards,
~VInu

"lmg" wrote:

> <g id= "hostgrouptest" >
> <rect  id= "host3" x="28%" y="42.2%" width="7%" height="10%"
> fill="lightgray" stroke="black" stroke-width="1"  rx="5" ry="2"
> onmouseover = "nodeovercommon(evt)"  onmousedown="nodetransformdown(evt)"
> onmousemove="nodetransformmove(evt)" onmouseup = "nodetransformup(evt)" >
> </rect>
> <image id="server" x="28%" y="42.2%" width="15" height="20"
> xlink:href="Server.png"/>
> 
> </g>
> 
> Code:
> 
> function  nodetransformmove(evt)
> { var
>  thenode = evt.target.parentNode.getAttribute("id");
> //得到父节点
> var parentnode = evt.target.ownerDocument.getElementById(thenode);
> alert("parentnode"+parentnode.childNodes.length);
>          }
>  why   parentnode.childNodes.length  is  5, I think  it should be 2, who can
> explain for me?
> 
> 
> 
> 
> 
> 
> 
> -- 
> 请查收,谢谢
> -------------
> 刘明贵 
> 
>
date: Tue, 13 May 2008 02:50:02 -0700   author:   Vinu

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us