[Xerte] childNodes count?

Dave Burnett d_b_burnett at hotmail.com
Fri Nov 19 11:12:57 GMT 2010


"Collections" according to Google.

debug(templateData.brand[0].navigation[0].length);

4

I tried that and about 2 dozen other variations.
I variously get undefined, 4 or 9.


From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Fri, 19 Nov 2010 08:37:47 +0000
Subject: RE: [Xerte] childNodes count?



They are objects (arrays I think), not XML Nodes. Try templateData.brand[0].navigation[0].length; //no childNodes on objects! From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 18 November 2010 20:53
To: Xerte list
Subject: [Xerte] childNodes count? 
Here's the structure being read into templateData:

<brand>
  <background graphic="intromen_ease.gif" x="0" y="0" w="100" h="200">
  </background>
  <navigation>
    <back swf="btnBack_ease.swf" tooltip="Previous page Shortcut-key: Alt+Left" x="100" y="200" w="100" h="200"></back>
    <next swf="btnNext_ease.swf" tooltip="Next page Shortcut-key: Alt+Right" x="200" y="200" w="100" h="200"></next>
    <home swf="btnHome_ease.swf" tooltip="Unit home page Shortcut-key: Alt+Home" x="300" y="200" w="100" h="200"></home>
    <open swf="btnOpen_ease.swf" tooltip="Open a unit Shortcut-key: Ctrl+O" x="400" y="200" w="100" h="200"></open>
    <dict swf="btnDict_ease.swf" tooltip="Show the Dictionary" x="500" y="200" w="100" h="200"></dict>
    <copy swf="btnCopy_ease.swf" tooltip="Copy text to your scrapbook" x="600" y="200" w="100" h="200"></copy>
  </navigation>
</brand>


inspect(templateData.brand[0].navigation[0])

gives me 6 children:

copy : null
dict : null
open : null
home : null
next : null
back : null


debug(templateData.brand[0].navigation[0].childNodes.length);

gives me 4


fah.






This message and any attachment are intended solely for the addressee and may 
contain confidential information. If you have received this message in error, 
please send it back to me, and immediately delete it.   Please do not use, 
copy or disclose the information contained in this message or in any attachment.  
Any views or opinions expressed by the author of this email do not necessarily 
reflect the views of the University of Nottingham.


This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20101119/ac22820e/attachment.html


More information about the Xerte mailing list