Pars XML for same TAG different LINE

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
Posts: 85
Joined: Sat Sep 26, 2015 12:59 pm

Pars XML for same TAG different LINE

Post by gilar » Mon Jul 09, 2018 3:54 am

Hello Everybody ....
I'm following this lesson ... n-xml-file
and Succes follow this tutorial
Now i have problem to pars XML for the same TAG in Different Line

Here is the XML file ... mDuM4jdUus ... 4pjA04nsUo

There is two TAG
<teams> --- i can pars this line
<teams> --- I can not pars this line

This is my code

Code: Select all

private command processPreferencesTree pTree
   local tTextColor
   put revXMLNodeContents(pTree, "xml/teams/teamNumber") into tTeamSatu
   local tTeamDua
   put revXMLChildNames(pTree, "xml/teams/teamNumber", return, "teamNumber", true) into tTeamDua

Comment and help would be appreciate

Best Regards

Gilar Kadarsah | Indonesia

Posts: 1576
Joined: Tue May 28, 2013 2:20 pm
Location: Italy

Re: Pars XML for same TAG different LINE

Post by MaxV » Wed Dec 12, 2018 7:03 pm

For the second result you need to use this path /xml/teams[2].
Use :

Code: Select all

put revXMLNodeContents(connID, "/xml/teams/detail/teamName"  ) 
put revXMLNodeContents(connID, "/xml/teams[2]/detail/teamName"  )
It works!
Livecode Wiki:
My blog:
To post code use this:

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”