|
-
Aug 2nd, 2014, 12:54 AM
#1
Thread Starter
Member
Insert Nodes with multiple Attributes
I need to insert nodes into an XML file. Three things make this complex:
1. The node names are duplicated throughout the file.
2. There are three attributes to create with some of the nodes.
3. The nodes need to be inserted at a specific location.
I need to insert the following:
<Markers Version="1">
<Marker Version="1" Index="0">
<Second ObjectRef="23"/>
<First>5009119315200</First>
</Marker>
<Marker Version="1" Index="1">
<Second ObjectRef="24"/>
<First>419274305049600</First>
</Marker>
</Markers>
Into the following:
<Markers ObjectID="22" ClassID="bee50706-b524-416c-9f03-b596ce5f6866" Version="2">
[insert thee above here]
<Node Version="1"/>
</Markers>
I then need to insert the following just after the above:
<Marker ObjectID="23" ClassID="a45508e0-3ff7-4d04-90a7-2e0dfff4c910" Version="2">
<Comments>comment abc</Comments>
<Duration>8475667200</Duration>
<Time>5009119315200</Time>
<Node Version="1">
<Properties Version="1">
<ML.Marker.TextName>chapter 00;00;19;21 name</ML.Marker.TextName>
<ML.SequenceMarker.Chapter>ThisIsAChapterMarkerFlag</ML.SequenceMarker.Chapter>
</Properties>
</Node>
<Name/>
</Marker>
====================================================================================
<Marker ObjectID="24" ClassID="a45508e0-3ff7-4d04-90a7-2e0dfff4c910" Version="2">
<Comments>comments last chapter</Comments>
<Duration>8475667200</Duration>
<Time>419274305049600</Time>
<Node Version="1">
<Properties Version="1">
<ML.Marker.TextName>chapter 00;27;30;18 name</ML.Marker.TextName>
<ML.SequenceMarker.Chapter>ThisIsAChapterMarkerFlag</ML.SequenceMarker.Chapter>
</Properties>
</Node>
<Name/>
</Marker>
==================================================================================
I have been trying just to read these values (from the file that produced the above in a manual process) in an attempt to understand how to insert them.
I have seen many "Answers" and suggestions, but nothing works.
I have had success with reading the attribute "ObjectID" "Version" names and values but not "ClassID" name or values.
I have used the following:
1. Create a NodeList (N is Nodelist.Lenght)
2. Use MsgBox to see:
Nodelist.item(1 Through N).Attributes.Item(0).BaseName
Nodelist.item(1 Through N).Attributes.Item(0).Text
Nodelist.item(1 Through N).Attributes.Item(0).nodeTypedvalue
Nodelist.item(1 Through N).Attributes.Item(0).nodeTypeString
Nodelist.item(1 Through N).Attributes.Item(0).nodeValue
I do not see the values or name for "ClassID"
In the end, I just need to create these nodes.
If anyone knows, Please Help
Thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|