Re: Timing Rescordset
- From: hgeron <hgeron@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 3 Sep 2006 10:35:01 -0700
Yes, I remember you said to check the node type, but I didn't see how how
that would help. Once again the problem is one type, like...
<P id="51" desc="109" name="PT">5403.84 3798.21 94.27</P>
The recursive function I am using first check to see if it has something, if
so it gets each attribute. Then it calls itself again and gets another node,
it has no attributes but it has node text, so it gets that, then calls itself
again.
You said this is two nodes... Ok... I see that the ">" seems to end the
node, but
the text part gives me no node name, but I know that it is the 3d coordinate
of a
surveyed point, and the attributes just collected were given as this point's
ID, Description, and "name". So I put them as one record. I excpect I will
have problems when I save changes and updates back to XML, but I am not at
that point yet. Currently I am placing everything in one table, but I know I
will need many other tables, each Node Name will need it's own table. If a
parameter query will not accept the node name as a parameter as a table name,
then I will have to use
a case select for the table name, but I am discovering new node names with
new survey types. It seems that should use a recordsets, and create tables
(as needed), and add attributes and text as I find them.
I think this is going to very time consuming...
(1) Read the XML node name, if any
(2) If I have attributes ,create a table if table of node name does not exist.
(3) Read each attribute
(4) Store attributes in table, go back to step (1)
(5) If I have no attributes, read text
(6) Assume the text when with last node name, and store text.
(7) Go back to step (1)
Is this logic ok? How would I check the node type, other than this what I am
doing already?
Function RecurseXMLs(Node As IXMLDOMNode, Level As Long) As Boolean
Set NodeList = Node.childNodes
If Not Node.Attributes Is Nothing Then
nodeName = Node.baseName
For Each Att In Node.Attributes
.... 'get each attribute
Next
End If
If Node.nodeType = NODE_TEXT Then
...'get node.text ...
Else
If Not NodeList Is Nothing Then
For Each ChildNode In NodeList
If RecurseXMLs(ChildNode, Level + 1) = False Then Exit Function
Next
End If
End If
RecurseXMLs = True
End Function
.
- Follow-Ups:
- Re: Timing Rescordset
- From: Mark J. McGinty
- Re: Timing Rescordset
- References:
- Re: Timing Rescordset
- From: Bob Barrows [MVP]
- Re: Timing Rescordset
- From: hgeron
- Re: Timing Rescordset
- From: Bob Barrows [MVP]
- Re: Timing Rescordset
- From: hgeron
- Re: Timing Rescordset
- From: Bob Barrows [MVP]
- Re: Timing Rescordset
- From: Bob Barrows [MVP]
- Re: Timing Rescordset
- Prev by Date: Re: Timing Rescordset
- Next by Date: Re: Timing Rescordset
- Previous by thread: Re: Timing Rescordset
- Next by thread: Re: Timing Rescordset
- Index(es):
Loading