Hi guys
I have a complex KML (at least to me it is) and I am trying to get a few info out of it....
The file structure (the part I need to parse) looks like this:
This "SchemaData" is repeated about 200 times, and from each block I need to extract the REF_CHAMBR and the CODE_CH1 values, but I just can't retrieve those values by name, nor I get to log the complete SimpleData as string so I could work them out of it.
This is my first try/use of xml parsing, so please be gentle with me!
I just need some pointers, like, should I try to get them within startelement or endelement?
How should I logic out that structure?
I have a complex KML (at least to me it is) and I am trying to get a few info out of it....
The file structure (the part I need to parse) looks like this:
B4X:
<Folder>
<name>Chambre_Merignac_Structure</name>
<Placemark>
<styleUrl>#m_ylw-pushpin0</styleUrl>
<ExtendedData>
<SchemaData schemaUrl="#Chambre_Merignac_Structure">
<SimpleData name="FID_1">-89451</SimpleData>
<SimpleData name="OBJECTID">49179</SimpleData>
<SimpleData name="STATUT">E</SimpleData>
<SimpleData name="IMPLANT">T</SimpleData>
<SimpleData name="NATURE_CHA">R</SimpleData>
<SimpleData name="REF_CHAMBR">L5T</SimpleData>
<SimpleData name="CODE_COM">33281</SimpleData>
<SimpleData name="ID_PROPRIE">1.00000000000</SimpleData>
<SimpleData name="ACC_DEPORT">0.00000000000</SimpleData>
<SimpleData name="VENTIL">0.00000000000</SimpleData>
<SimpleData name="PLAFON">0.00000000000</SimpleData>
<SimpleData name="ID_GESTION">0.00000000000</SimpleData>
<SimpleData name="INDEX_DOC_">0.00000000000</SimpleData>
<SimpleData name="ID_NOEUD">0.00000000000</SimpleData>
<SimpleData name="ROTATION">302.50000000000</SimpleData>
<SimpleData name="CODE_CH1">9759</SimpleData>
<SimpleData name="CODE_CH2">33281</SimpleData>
<SimpleData name="NOTE">57DDCE287F26218C1BFE3C5215AB4BC6</SimpleData>
<SimpleData name="SECURISEE">0.00000000000</SimpleData>
<SimpleData name="CLE_MKT1">33281||</SimpleData>
<SimpleData name="CLE_MKT2">9759|33281</SimpleData>
<SimpleData name="CLASSE">B</SimpleData>
<SimpleData name="X">365789.90000000002</SimpleData>
<SimpleData name="Y">1983938.00000000000</SimpleData>
<SimpleData name="POINT_X">0.00000000000</SimpleData>
<SimpleData name="ID">365789,865500003_1983938,2315</SimpleData>
<SimpleData name="Class">Structurant</SimpleData>
</SchemaData>
</ExtendedData>
<Point>
<coordinates>-0.6237452667855941,44.816488002257,0</coordinates>
</Point>
</Placemark>
<Placemark>
<styleUrl>#m_ylw-pushpin0</styleUrl>
<ExtendedData>
<SchemaData schemaUrl="#Chambre_Merignac_Structure">
<SimpleData name="FID_1">-92385</SimpleData>
<SimpleData name="OBJECTID">50767</SimpleData>
<SimpleData name="STATUT">E</SimpleData>
<SimpleData name="IMPLANT">T</SimpleData>
<SimpleData name="NATURE_CHA">H</SimpleData>
<SimpleData name="REF_CHAMBR">OHN</SimpleData>
<SimpleData name="REF_NOTE">F2.</SimpleData>
<SimpleData name="CODE_COM">33318</SimpleData>
<SimpleData name="CODE_VOIE">3280</SimpleData>
<SimpleData name="NUM_VOIE">52</SimpleData>
<SimpleData name="ID_PROPRIE">1.00000000000</SimpleData>
<SimpleData name="ACC_DEPORT">0.00000000000</SimpleData>
<SimpleData name="VENTIL">0.00000000000</SimpleData>
<SimpleData name="PLAFON">0.00000000000</SimpleData>
<SimpleData name="ID_GESTION">0.00000000000</SimpleData>
<SimpleData name="QUANTIFICA">#PA:6#</SimpleData>
<SimpleData name="INDEX_DOC_">0.00000000000</SimpleData>
<SimpleData name="ID_NOEUD">0.00000000000</SimpleData>
<SimpleData name="ROTATION">284.00000000000</SimpleData>
<SimpleData name="CODE_CH1">6079</SimpleData>
<SimpleData name="CODE_CH2">33318</SimpleData>
<SimpleData name="NOTE">57DDCE290BD070D81BFE3C4BA6AAC648</SimpleData>
<SimpleData name="SECURISEE">0.00000000000</SimpleData>
<SimpleData name="CLE_MKT1">33318|3280|52</SimpleData>
<SimpleData name="CLE_MKT2">6079|33318</SimpleData>
<SimpleData name="CODE_CH1_C">A717</SimpleData>
<SimpleData name="CODE_CH2_P">33318</SimpleData>
<SimpleData name="CLASSE">B</SimpleData>
<SimpleData name="X">365871.00000000000</SimpleData>
<SimpleData name="Y">1983760.00000000000</SimpleData>
<SimpleData name="POINT_X">0.00000000000</SimpleData>
<SimpleData name="ID">365870,976000004_1983760,371</SimpleData>
<SimpleData name="Class">Structurant</SimpleData>
</SchemaData>
</ExtendedData>
<Point>
<coordinates>-0.622636421284825,44.8149168698937,0</coordinates>
</Point>
</Placemark>
<Placemark>
<styleUrl>#m_ylw-pushpin0</styleUrl>
<ExtendedData>
<SchemaData schemaUrl="#Chambre_Merignac_Structure">
<SimpleData name="FID_1">-95887</SimpleData>
<SimpleData name="OBJECTID">52707</SimpleData>
<SimpleData name="STATUT">E</SimpleData>
<SimpleData name="IMPLANT">T</SimpleData>
<SimpleData name="NATURE_CHA">H</SimpleData>
<SimpleData name="REF_CHAMBR">OHN</SimpleData>
<SimpleData name="REF_NOTE">B2.</SimpleData>
<SimpleData name="CODE_COM">33318</SimpleData>
<SimpleData name="CODE_VOIE">3280</SimpleData>
<SimpleData name="NUM_VOIE">67</SimpleData>
<SimpleData name="ID_PROPRIE">1.00000000000</SimpleData>
<SimpleData name="ACC_DEPORT">0.00000000000</SimpleData>
<SimpleData name="VENTIL">0.00000000000</SimpleData>
<SimpleData name="PLAFON">0.00000000000</SimpleData>
<SimpleData name="ID_GESTION">0.00000000000</SimpleData>
<SimpleData name="QUANTIFICA">#PA:36#</SimpleData>
<SimpleData name="INDEX_DOC_">0.00000000000</SimpleData>
<SimpleData name="ID_NOEUD">0.00000000000</SimpleData>
<SimpleData name="ROTATION">286.00000000000</SimpleData>
<SimpleData name="CODE_CH1">6084</SimpleData>
<SimpleData name="CODE_CH2">33318</SimpleData>
<SimpleData name="NOTE">57DDCE2922E678FB1BFE3C4BCFAACBE1</SimpleData>
<SimpleData name="SECURISEE">0.00000000000</SimpleData>
<SimpleData name="CLE_MKT1">33318|3280|67</SimpleData>
<SimpleData name="CLE_MKT2">6084|33318</SimpleData>
<SimpleData name="CODE_CH1_C">A1782</SimpleData>
<SimpleData name="CODE_CH2_P">33318</SimpleData>
<SimpleData name="CLASSE">B</SimpleData>
<SimpleData name="X">365836.20000000001</SimpleData>
<SimpleData name="Y">1983867.00000000000</SimpleData>
<SimpleData name="POINT_X">0.00000000000</SimpleData>
<SimpleData name="ID">365836,141000003_1983867,3125</SimpleData>
<SimpleData name="Class">Structurant</SimpleData>
</SchemaData>
</ExtendedData>
<Point>
<coordinates>-0.6231271746075751,44.8158662591759,0</coordinates>
</Point>
</Placemark>
<Placemark>
<styleUrl>#m_ylw-pushpin0</styleUrl>
<ExtendedData>
<SchemaData schemaUrl="#Chambre_Merignac_Structure">
<SimpleData name="FID_1">-96097</SimpleData>
<SimpleData name="OBJECTID">52822</SimpleData>
<SimpleData name="STATUT">E</SimpleData>
<SimpleData name="IMPLANT">C</SimpleData>
<SimpleData name="NATURE_CHA">H</SimpleData>
<SimpleData name="REF_CHAMBR">OHN</SimpleData>
<SimpleData name="REF_NOTE">1TER PRO</SimpleData>
<SimpleData name="CODE_COM">33281</SimpleData>
<SimpleData name="CODE_VOIE">2780</SimpleData>
<SimpleData name="NUM_VOIE">83</SimpleData>
<SimpleData name="ID_PROPRIE">1.00000000000</SimpleData>
<SimpleData name="ACC_DEPORT">0.00000000000</SimpleData>
<SimpleData name="VENTIL">0.00000000000</SimpleData>
<SimpleData name="PLAFON">0.00000000000</SimpleData>
<SimpleData name="ID_GESTION">0.00000000000</SimpleData>
<SimpleData name="INDEX_DOC_">0.00000000000</SimpleData>
<SimpleData name="ID_NOEUD">0.00000000000</SimpleData>
<SimpleData name="ROTATION">301.30000000000</SimpleData>
<SimpleData name="CODE_CH1">7365</SimpleData>
<SimpleData name="CODE_CH2">33281</SimpleData>
<SimpleData name="NOTE">57DDCE28D1E669181BFE3C4631AA35C7</SimpleData>
<SimpleData name="SECURISEE">0.00000000000</SimpleData>
<SimpleData name="CLE_MKT1">33281|2780|83</SimpleData>
<SimpleData name="CLE_MKT2">7365|33281</SimpleData>
<SimpleData name="CODE_CH1_C">810</SimpleData>
<SimpleData name="CODE_CH2_P">33281</SimpleData>
<SimpleData name="CLASSE">B</SimpleData>
<SimpleData name="X">365746.09999999998</SimpleData>
<SimpleData name="Y">1984005.00000000000</SimpleData>
<SimpleData name="POINT_X">0.00000000000</SimpleData>
<SimpleData name="ID">365746,077_1984005,107</SimpleData>
<SimpleData name="Class">Structurant</SimpleData>
</SchemaData>
</ExtendedData>
This "SchemaData" is repeated about 200 times, and from each block I need to extract the REF_CHAMBR and the CODE_CH1 values, but I just can't retrieve those values by name, nor I get to log the complete SimpleData as string so I could work them out of it.
This is my first try/use of xml parsing, so please be gentle with me!
I just need some pointers, like, should I try to get them within startelement or endelement?
How should I logic out that structure?