Adding XML Child with ID

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
jabramson623
Posts: 1
Joined: Sat Jun 20, 2020 11:44 pm

Adding XML Child with ID

Post by jabramson623 » Sat Jun 20, 2020 11:52 pm

Having trouble wrapping my head around this one. If I manually add this child to the XML document, I can read and write, but I'm trying to figure out how to add the child via LC.

Code: Select all

<Preferences>
  <Graphics>
     <Meeting IDnum="1">
        <title>Meeting #1</title>
        <time>3:00pm</time>
    </Meeting>
     <Meeting IDnum="2">
        <title>Meeting #2</title>
        <time>4:00pm</time>
    </Meeting>
  </Graphics>
</Preferences>
How would I add/insert the meeting into IDnum #3, or add to the end at the next valid number?

kdjanz
Posts: 300
Joined: Fri Dec 09, 2011 12:12 pm

Re: Adding XML Child with ID

Post by kdjanz » Sun Jun 21, 2020 4:50 am

Look up the XML library in the associations section in the left pane of the dictionary window. If you click on XML Library, it will filter all the XML properties and commands for you so that you can read about the command revXMLAddNode which I think is what you need.

I'm just a beginner too and have never used XML, but I hope this points you in the right direction.

kelly

Post Reply