Vba xml dom nodes in Excel

In the previous chapter, we saw the basics of DOM or Document Object Model.

The DOM specifies the Logical structure of the XML document.

In this chapter, we will explore the DOM Nodes in detail.

What is a Node?

According to the Document Object Model of XML, everything in a XML file is a node.

The entire document is a document node.

Every XML element is an element node.

The text in the XML elements are text nodes.

Every attribute is an attribute node.

Comments are comment nodes.

Consider the following XML document as an example.

  1. <?xml�version="1.0"�encoding="UTF-8"?>
  2. <Agencies>
  3. <Contractor>
  4. excel vba xml dom nodes

  5. ����<name>Bhandhan Servicing</name>
  6. ����<service_type>Marriage arrangement</service_type>
  7. ����<description>
  8. All Services related to marriages
  9. ���</description>
  10. </Contractor>
  11. <Contractor>
  12. ����<name>VS functions</name>
  13. ����<service_type>Party arrangements</service_type>
  14. ����<description>
  15. Official get together, birthday party arrangements.
  16. ����</description>
  17. </Contractor>
  18. <Contractor>
  19. ����<name>Swami services</name>
  20. ����<service_type>Spiritual Services</service_type>
  21. ����<description>
  22. ��� Ganapathi homam, New home poojas performed.
  23. ����</description>
  24. </Contractor>
  25. <Contractor>
  26. ����<name>B Plus Services</name>
  27. ����<service_type>Blood Donation</service_type>
  28. ����<description>
  29. ��� Conducts Blood donation camps, organizing emergency blood donation
  30. ����</description>
  31. ����<calories>600</calories>
  32. </Contractor>
  33. </Agencies>

With reference to the above XML document, we will explore the various nodes discussed above.

<Agencies> is the root node of the document.

<Contractor> is the child node of the root node <bookstore>

<Contractor> node holds the child nodes: <name>, <service_type> and <description>.

The child nodes contain one text node each in every Contrator nodes and its child nodes.


You can find similar Excel Questions and Answer hereunder

1) Is there a way to get a log value of a number using Excel?

2) I have several pictures that are misaligned - manually aligning them is very laborious. Is there an automatic alignment option?

3) How can I dynamically add a hyperlink using VBA?

4) What is the xml group in the developer tab in Excel

5) How to convert a number or string into a data with the cdate function

6) Every time I make an update to my Worksheet, I would like to add a timestamp to my Last Updated field. In Excel, how can I do that in Worksheet?

7) How can I enter a cent symbol in a cell?

8) Want to use SQL to manipulate a database. Here some basic explanation to get you started.

9) How can I enter a cent symbol in a cell?

10) How do I enter a formula in a cell using VBA (using Absolute Reference)?


Here the previous and next chapter