?
Solved

Get proc. instruct. using MSXML DOM

Posted on 2000-04-19
1
Medium Priority
?
359 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 400 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

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

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

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

719 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