the .length property

Results 1 to 2 of 2

Thread: the .length property

  1. #1
    Eggy Guest

    Default the .length property

    I&#039m working with ASP and XML and am having some trouble with obtaining the length of my my document. It loads the xml document corrcetly however when I try to obtain the length of the document for a loop it will give the the following error:<BR><BR><BR>Microsoft VBScript runtime (0x800A01A8)<BR>Object required: &#039documentElement.childNodes.length&#039<BR><BR >I have tried it using my root var. for the document element as well as assigning a var. to the childnodes as well. I have also tried not to assigning the value to a var. but that too doesn&#039t work. Can anyone help me out?

  2. #2
    Matiur Rahman Guest

    Default RE: You need to set/select a node first..

    I think you need to select a node from the document. then you can have access to its childNodes. Some thing like the following. The following code work on my ASP. Hope this helps.<BR><BR>&#060;&#060;---- <BR>Set xmlNode = objXML.documentElement.selectSingleNode("//" & cstr(strSubNode)) <BR> Set xmlChildList = xmlNode.childNodes <BR> dim intLength <BR> intLength=cint(xmlChildList.length) <BR>--&#062;&#062;<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts