%% /xml public
set-string xmld unquoted =<?xml version="1.0" encoding="UTF-8"?>\
<countries>\
<country id='1'>\
<name>USA&America</name>\
<state id='1'>Arizona\
<city id="1">\
<name>Phoenix</name>\
<population>5000000</population>\
</city>\
<city id="2">\
<name>Tuscon</name>\
<population>1000000</population>\
</city>\
</state>\
<state id='2'>California\
<city id="1">\
<name>Los Angeles</name>\
<population>19000000</population>\
</city>\
<city id="2">\
<name>Irvine</name>\
</city>\
</state>\
</country>\
<country id='2'>\
<name>Mexico</name>\
<state id='1'>Veracruz\
<city id="1">\
<name>Xalapa-Enriquez</name>\
<population>8000000</population>\
</city>\
<city id="2">\
<name>C\u00F3rdoba</name>\
<population>220000</population>\
</city>\
</state>\
<state id='2'>Sinaloa\
<city id="1">\
<name>Culiac\u00E1n Rosales</name>\
<population>3000000</population>\
</city>\
</state>\
</country>\
</countries>
xml-doc xmld to x
start-loop
read-xml x key k value v status s next
if-true s equal GG_ERR_EXIST
break-loop
end-if
text-utf v
@Key [<<p-out k>>] Value [<<p-out v>>]
end-loop
xml-doc delete x
%%
Copied!
Key [countries/country/id/@] Value [1]
Key [countries/country/name/] Value [USA&America]
Key [countries/country/state/id/@] Value [1]
Key [countries/country/state/city/id/@] Value [1]
Key [countries/country/state/city/name/] Value [Phoenix]
Key [countries/country/state/city/population/] Value [5000000]
Key [countries/country/state/city/id/@] Value [2]
Key [countries/country/state/city/name/] Value [Tuscon]
Key [countries/country/state/city/population/] Value [1000000]
Key [countries/country/state/] Value [Arizona]
Key [countries/country/state/id/@] Value [2]
Key [countries/country/state/city/id/@] Value [1]
Key [countries/country/state/city/name/] Value [Los Angeles]
Key [countries/country/state/city/population/] Value [19000000]
Key [countries/country/state/city/id/@] Value [2]
Key [countries/country/state/city/name/] Value [Irvine]
Key [countries/country/state/] Value [California]
Key [countries/country/id/@] Value [2]
Key [countries/country/name/] Value [Mexico]
Key [countries/country/state/id/@] Value [1]
Key [countries/country/state/city/id/@] Value [1]
Key [countries/country/state/city/name/] Value [Xalapa-Enriquez]
Key [countries/country/state/city/population/] Value [8000000]
Key [countries/country/state/city/id/@] Value [2]
Key [countries/country/state/city/name/] Value [Córdoba]
Key [countries/country/state/city/population/] Value [220000]
Key [countries/country/state/] Value [Veracruz]
Key [countries/country/state/id/@] Value [2]
Key [countries/country/state/city/id/@] Value [1]
Key [countries/country/state/city/name/] Value [Culiacán Rosales]
Key [countries/country/state/city/population/] Value [3000000]
Key [countries/country/state/] Value [Sinaloa]
Copied!