Accessing a single node...

Results 1 to 2 of 2

Thread: Accessing a single node...

  1. #1
    Join Date
    Dec 1969

    Default Accessing a single node...

    Hi everybody<BR><BR>I try to access the data of a single node using ASP. The code is the following :<BR>********************(briefly)<BR>Set objDom = Server.CreateObject("Microsoft.XMLDOM")........<BR >Set anode = objDom.SelectSingleNode("a/b[@id=&#039;" & c & "&#039;]/d/e")<BR>If anode.Text = something Then<BR>(do something)<BR>End If<BR>********************<BR>Then the following error comes up: <BR>--------------------<BR>Error Type:<BR>Microsoft VBScript runtime (0x800A01A8)<BR>Object required: &#039;anode&#039;<BR>--------------------<BR><BR>Is there something I&#039;m missing?<BR><BR>Thank you!

  2. #2
    Join Date
    Dec 1969

    Default means it didn't find the node

    ...Trying to reference the .Text property of an empty object will generate an error.<BR><BR>I&#039;m assuming you&#039;ve left out the code to load the xml on purpose. Plus, if you are starting from the root node, I think you need to <BR><BR> Set anode = objDom.selectSingleNode("//a/b[@id=&#039;" & c & "&#039;]/d/e")<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