Solved

Get proc. instruct. using MSXML DOM

Posted on 2000-04-19
1
358 Views
Last Modified: 2012-05-04
How do I get the first processing instruction in an XML document, using Microsoft's DOM API?

For example:
<?xml version="1.0" standalone="yes"?>
<root>
  <?process action="ignore"?>
  <test/>
</root>

In this example I can get the "process" node alright, but the "xml" processing instruction I cannot.  The way I retrieve the XML nodes is by first getting the document element and then going through the tree.
0
Comment
Question by:sgerlach
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
abk102299 earned 100 total points
ID: 2735311
Dim root
Dim xmlDoc
Dim processNode
 
Set xmlDoc = CreateObject("microsoft.xmldom")
xmlDoc.async = False
xmlDoc.load("example.xml")
'Set root to the XML document's root element, COLLECTION:
Set root = xmlDoc.documentElement
'Set processNode to the "xml" processing instruction ( in case of your example input )
Set processNode = root.previousSibling

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question