Having trouble adding to xml file

Results 1 to 2 of 2

Thread: Having trouble adding to xml file

  1. #1
    Join Date
    Dec 1969

    Default Having trouble adding to xml file

    I am having some trouble adding to an already created xml file. I set the root but its still giving me a <BR><BR>Object required: &#039;xmldoc.DocumentElement&#039; <BR><BR>My source code is as follows:<BR><BR>Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")<BR><BR>Set Root = xmldoc.DocumentElement<BR><BR>Set onode = xmldoc.createNode("element","Contractor","")<BR> xmldoc.documentElement.appendChild(onode)<BR><BR> Set inode=xmldoc.createNode("element","Contractornum", "")<BR> inode.Text = connum<BR> onode.appendChild (inode)<BR><BR> Set child=xmldoc.createNode("element","Contractorname" ,"")<BR> child.Text = conname<BR> onode.appendChild (child)<BR><BR><BR>Matt

  2. #2
    Richard Chisholm Guest

    Default RE: Having trouble adding to xml file

    &nbsp;<BR>If you are trying to add to an existing file, don&#039;t you need to load it into memory first with xmldoc.load()? <BR><BR>Hope that helps<BR><BR>Richard

Posting Permissions

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