Jump to content

[Ajuda] Leitura Grupos xml /xmlNodeGetChildren


Recommended Posts

Preciso de ajuda em um script que tem como objetivo ler os varios grupos do xml

Neste momento

local metaXML = xmlLoadFile("vehicles.xml") 
    if metaXML then          
        for i, m in ipairs(xmlNodeGetChildren(metaXML)) do 
            local NameXML = xmlNodeGetName(m) 
  

Este codigo apenas lê os primeiros grupos " os principais os ( Pgroup ) . Queria que lesse também os group dentro..

Se alguem poder ajuda .. ty

    <Pgroup name="Aircraft"> 
        <group name="Helicopters"> 
            <vehicle id="548" name="Cargobob" /> 
            <vehicle id="425" name="Hunter" /> 
            <vehicle id="417" name="Leviathan" /> 
            <vehicle id="487" name="Maverick" /> 
            <vehicle id="488" name="News Chopper" /> 
            <vehicle id="497" name="Police Maverick" /> 
            <vehicle id="563" name="Raindance" /> 
            <vehicle id="447" name="Seasparrow" /> 
            <vehicle id="469" name="Sparrow" /> 
        </group> 
        <group name="Planes, Jets and Airlines"> 
            <vehicle id="592" name="Andromada" /> 
            <vehicle id="577" name="AT-400" /> 
            <vehicle id="511" name="Beagle" /> 
            <vehicle id="512" name="Cropduster" /> 
            <vehicle id="593" name="Dodo" /> 
            <vehicle id="520" name="Hydra" /> 
            <vehicle id="553" name="Nevada" /> 
            <vehicle id="476" name="Rustler" /> 
            <vehicle id="519" name="Shamal" /> 
            <vehicle id="460" name="Skimmer" /> 
            <vehicle id="513" name="Stuntplane" /> 
        </group> 
    </Pgroup> 
 <Pgroup name="Bikes"> 
        <group name="Motorbikes"> 
            <vehicle id="581" name="BF-400" /> 
            <vehicle id="462" name="Faggio" /> 
            <vehicle id="521" name="FCR-900" /> 
            <vehicle id="463" name="Freeway" /> 
            <vehicle id="523" name="HPV1000" /> 
            <vehicle id="522" name="NRG-500" /> 
            <vehicle id="461" name="PCJ-600" /> 
            <vehicle id="448" name="Pizza Boy" /> 
            <vehicle id="468" name="Sanchez" /> 
            <vehicle id="586" name="Wayfarer" /> 
            <vehicle id="471" name="Quadbike" /> 
        </group> 
        <group name="Bicycles"> 
            <vehicle id="509" name="Bike" /> 
            <vehicle id="481" name="BMX" /> 
            <vehicle id="510" name="Mountain bike" /> 
        </group> 
    </Pgroup> 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...