[Xerte] childNodes count?

Julian Tenney Julian.Tenney at nottingham.ac.uk
Fri Nov 19 08:37:47 GMT 2010


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.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20101119/32f9f083/attachment.html


More information about the Xerte mailing list