Of course, it should be:
for (i=0; i<numPoints; i++) {
var myX = myPoints.item(i).getAttributeNS(null,'x');
var myY = myPoints.item(i).getAttributeNS(null,'y');
myPathArray = myPathArray+' '+myX+' '+myY;
}
works nicely in FF & ASV
Alan
--- In [email protected], "krugerboy1971"
<[EMAIL PROTECTED]> wrote:
>
> Good morning Group
>
> I have an XML fragment which I am trying to use to draw a path:
>
> <ons:Boundary id="L100">
> <ons:Point x="466300" y="101000"/>
> <ons:Point x="473300" y="101000"/>
> <ons:Point x="468300" y="103000"/>
> <ons:Point x="466300" y="103000"/>
> </ons:Boundary>
>
> The following script works perfectly in Firefox but not in ASV -
ASV
> returns the correct number of Point objects (numPoints=4) but
> doesn't like "myPoints[i].getAttributeNS(null,'x');" ,
> returning "'undefined' is null or not an object" - any suggestions
> as to how to access the x/y attributes in ASV??
>
> var myPath = svgDoc.getElementById('L100');
> var myPoints = myPath.getElementsByTagNameNS
> ("http://www.statistics.gov.uk","Point")
> var numPoints = myPoints.length;
> var myPathArray = 'M';
> //builds up co-ordinate pairs for path object
> for (i=0; i<numPoints; i++) {
> var myX = myPoints[i].getAttributeNS(null,'x');
> var myY = myPoints[i].getAttributeNS(null,'y');
> myPathArray = myPathArray+' '+myX+' '+myY;
> }
>
> //define end co-ordinates and finishes path element
> var endX = myPoints[0].getAttributeNS(null,'x');
> var endY = myPoints[0].getAttributeNS(null,'y');
> myPathArray = myPathArray+' '+endX+' '+endY+' Z';
>
>
> var newPath = svgDoc.createElementNS
> ('http://www.w3.org/2000/svg',"path")...etc etc
>
-----
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/