Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

sjakiePP (Programmer) (OP)
24 Apr 09 7:44
In my Dictionary I have several DOMDocuments. These are taken out of the dict with XMLDocAOHA. To append this document to a Node I have to convert the DomDocument to an IXMLNode. I'm using Xpath to do this.

Then I am adding the new XMLNode to XMLNodeBasisBody, but then I get Error 438. What causes this error?

CODE

If dicNummerAanduidingen.Exists(strHoofdAdres) Then
  'as DomDocument
  Set XMLDocAOHA = dicNummerAanduidingen.Item(strHoofdAdres)
  'add to body, casted to node. doc is not ok
  ' selectsinglenode returns a node
  Set XMLNode = XMLDocAOHA.selectSingleNode("/")
                
  'As DomNode
  Set XMLNode = dicNummerAanduidingen.Item(strHoofdAdres)
  XMLNodeBasisBody.appendChild (XMLNode)
Else
  Err.Raise 32001, "Samengesteld.maakSamengesteldBericht", "No Hoofdadres found for " & strHoofdAdres
End If

(I have translated the comments to English)

---------------------------------------------
Yes, the world is full of strange people.

sjakiePP (Programmer) (OP)
24 Apr 09 9:25
When trying to append the 438-Error is thrown, but my XMLNode is appended to my XMLNodeBasisBody. So I have put On Error Resume Next above it, so it does not bother me again, and again, and again, and again......

Did anyone else have this problem?

---------------------------------------------
Yes, the world is full of strange people.

PHV (MIS)
24 Apr 09 9:56
Just to know, what is the error message ?
tsuji (TechnicalUser)
24 Apr 09 11:34
[1] You have two different lines defining XMLNode. The second line, I do not recognize what it is. In any case, these methods Exists(), Item() in your context, are they proprietary?

[2] This is just a beautiful misunderstanding if XMLDocAOHA is a DOMDocument:
>Set XMLNode = XMLDocAOHA.selectSingleNode("/")
XMLNode is exactly the same as XMLDocAOHA, a DOMDocument. It is not any other type.

[2.1] If you want to append it, use this definition should do.
>Set XMLNode = XMLDocAOHA.selectSingleNode("/")
Set XMLNode = XMLDocAOHA.DocumentElement

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close