Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > IXMLDOMNode vs. IXMLDOMElement?


Reply
 
Thread Tools Display Modes
  #1  
Old 07-27-2005, 10:02 AM
A2Z A2Z is offline
Newcomer
 
Join Date: Jul 2005
Posts: 1
Default IXMLDOMNode vs. IXMLDOMElement?


Can some explain the difference between IXMLDOMNode vs. IXMLDOMElement and give an example of when each one should be used.

I am new to XML and am building an XML string to submit through HTTPS.

The object I am creating is relatively simple but some elements require attributes to be set which only seem to be available for elements instatiated as IXMLDOMElement. Can IXMLDOMNode elements contain data or is this type limited to group headers within an XML structure?


Sample:

' Create <Subjects> element
Dim Subjects As IXMLDOMNode
Set Subjects = CNConsumerRequest.appendChild(reqDoc.createElement("Subjects"))

' Create <Subject> element
Dim Subject As IXMLDOMElement
Set Subject = Subjects.appendChild(reqDoc.createElement("Subject"))
Subject.setAttribute "SubjectType", "SUBJ"

' Create <SubjectName> element
Dim SubjectName As IXMLDOMElement
Set SubjectName = Subject.appendChild(reqDoc.createElement("SubjectName"))
SubjectName.appendChild(reqDoc.createElement("LastName")).Text = "LAST_NAME"


Sample:

<CNCustomerInfo>
<CustomerCode>String</CustomerCode>
<CustomerInfo>
<CustomerNumber>String</CustomerNumber>
<SecurityCode>String</SecurityCode>
</CustomerInfo>
<CustomerId>String</CustomerId>
</CNCustomerInfo>
<CNRequests>
<CNConsumerRequests>
<CNConsumerRequest>
<Subjects>
<Subject subjectType="SUBJ">
<SubjectName>
<LastName>String</LastName>
<FirstName>String</FirstName>
</SubjectName>
<DateOfBirth>1967-08-13</DateOfBirth>
</Subject>
<Addresses>
<Address addressType="CURR">
<StreetName>String</StreetName>
<Suite>String</Suite>
<City code="String">String</City>
<Province code="String" description="String"/>
<PostalCode>String</PostalCode>
</Address>
</Addresses>
</Subjects>
<CustomerInfo>
<CustomerNumber>String</CustomerNumber>
<SecurityCode>String</SecurityCode>
</CustomerInfo>
</CNConsumerRequest>
</CNConsumerRequests>
</CNRequests>
</CNCustTransmitToEfx>
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->