0

I need to insert nodes into an existing xml file. This operation will create what has to be done manually. This particular xml file has attributes (as seen using my XML viewer) for some of the nodes. Some have as many as 3 attributes. They are named ObjectId, ClassId and Version.

I can't seem to figure out how to insert these nodes with these attributes. Below is a sample of what needs to be inserted:

<Markers ObjectID="22" ClassID="bee50706-b524-416c-9f03-b596ce5f6866" Version="2">
    <Markers Version="1">
        <Marker Version="1" Index="0">
            <Second ObjectRef="23"/>
            <First>0</First>
        </Marker>
        <Marker Version="1" Index="1">
            <Second ObjectRef="24"/>
            <First>8475667200</First>
        </Marker>
        <Marker Version="1" Index="2">
            <Second ObjectRef="25"/>
            <First>254270016000</First>
        </Marker>
        <Marker Version="1" Index="3">
            <Second ObjectRef="26"/>
            <First>72051646867200</First>
        </Marker>
        <Marker Version="1" Index="4">
            <Second ObjectRef="27"/>
            <First>471925149696000</First>
        </Marker>
    </Markers>
    <Node Version="1"/>
</Markers>

This represents 4 markers in a video timeline. The above is only a reference to additional nodes that need to be created. If I can see how to add these, I believe I can do the rest.

Are these attribute names just arbitrary names or is object ID, Class ID and Version specific node attribute types?

Your help will make a very tedious process easy / simple. Thanks

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Mike
  • 9
  • 1

1 Answers1

0

The attribute names of ObjectID, ClassID and Version are specific to the application that is using this file, but they are not specific to XML itself.

It's very easy to work with XML in .NET, but a little harder in VB6. Still, you're not out of luck. I would look at the top answer to this question, which provides guidance on how to work with XML in VB6.

If that doesn't work for you, you can work with the file as if it were just a text file and make sure that you use the name attributes and tag names (remember: XML is case-sensitive!).

Community
  • 1
  • 1
DWRoelands
  • 4,878
  • 4
  • 29
  • 42