Re: parsing xml
- From: "Mark J. McGinty" <mmcginty@xxxxxxxxxxxxxxx>
- Date: Mon, 14 Aug 2006 15:54:57 -0700
"hgeron" <hgeron@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A1657E7E-72F2-47B9-AFEC-521E4ADC60F3@xxxxxxxxxxxxxxxx
MSXML5 is confusing.
There should be a simple way, once the DOM is accessed
in an Access module (VB and ADO) to
locate the root node and walk thru each and every
node, element, and attribute... but I have not been able
to figure out the MSXML keywords.
1. Set the DOM
2. find how many nodes
No need with For Each...
Dim Node As MSXML.IXMLDOMNode
Dim NodeList As MSXML.IXMLDOMNodeList
Set NodeList = Dom.childNodes
For Each Node In NodeList
[...]
Next
3. for each node ; msgbox the node
You could be clicking Ok for a long time! :-)
4. find how many elements
5. for each element ; msgbox the element
I'm not sure how the concept of elements (as opposed to nodes) applies. A
node has a ChildNodes collection and an Attributes collection. You would
have to recurse each node with ChildNodes.length > 0.
6. find how many attributes
7. for each attribute ; msgbox the attribute
Dim Attribute As MSXML.IXMLDOMAttribute
For Each Attribute In Node.Attributes
[...]
Next
One sub routine should read any XML, right?
Of course depending on the responses, you could program
the correct followup, but why wouldn't this work...
Impossible to even speculate without seeing your code. Does it throw any
errors? Have you stepped through it in the debugger and examined the
object[s] state[s] at each step.
I can't make it work. Does anyone out there work with this?
I do, surely thousands of others do as well. Note that all object name
examples above assume MSXML 2.0, the library prefix will have to be
adjusted, perhaps some object/interface names as well (but I think all of
them I mentioned are valid in later versions.)
-Mark
Harrell Geron
--
hgeron
.
- Follow-Ups:
- Re: parsing xml
- From: hgeron
- Re: parsing xml
- Prev by Date: Re: Recordset Persistence Doesn't Preserve Carriage Returns?
- Next by Date: Re: Recordset Persistence Doesn't Preserve Carriage Returns?
- Previous by thread: Re: The ConnectionString property has not been initialized.
- Next by thread: Re: parsing xml
- Index(es):
Relevant Pages
|
|