Solved

Get proc. instruct. using MSXML DOM

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 …
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now