Solved

Get proc. instruct. using MSXML DOM

Posted on 2000-04-19
1
356 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
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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. 
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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