I had deleted this because I found a solution on my own, but then I got a message from someone who was interested in how I did it, so I’m un-deleting this. Solution posted as a reply.
I have XML files that don’t use attributes. This is out of habit, but also in keeping with W3School’s recommendations.
Almost all of the documentation I see for Xojo XML parsing is based on self-closing tags with the data in attributes. My XML file looks like this:
<Project> <!-- GLOBAL PROJECT INFORMATION --> <Name></Name> <Gauge>0</Gauge> <ColorMode>0</ColorMode> <ColorDepth>0</ColorDepth> <HDRMode>0</HDRMode> <ResX>4096</ResX> <ResY>3112</ResY> <CameraOriginX>0</CameraOriginX> <CameraOriginY>0</CameraOriginY> <OutputFileFormat>0</OutputFileFormat> <!-- CLIP INFORMATION --> <ClipList> <Clip> <ClipName></ClipName> <ClipPath></ClipPath> <ClipStartFrameNo></ClipStartFrameNo> <ClipEndFrameNo></ClipEndFrameNo> <ClipSequencePadding>7</ClipSequencePadding> </Clip> </ClipList> </Project>
In this file, all the data resides between the element tags rather than inside a self-closing element, in keeping with how I was taught to structure XML. I find it to be much easier to read this way, too. In any case, when I read this into an XMLDocument, how do I get the data of each element?
When I set a break in my code and look at the current element as I’m walking through the XML tree, I can only find the data in ToString:
Does this mean I need to parse that to extract the actual data? That seems odd to me.