Seitenhistorie
...
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
local xml2lua = require("xml2lua") local handler = require("xmlhandler.tree") local xml = [[ <?xml version="1.0" encoding="UTF-8"?> <Table name="Einsatzdaten"> <Data type="STRING" header="Einsatznummer"/> <Data type="STRING" header="Einsatzstichwort"/> <Data type="STRING" header="Meldebild"/> <Row> <Column value="1234567890"/> <Column value="B2.5"/> <Column value="Rauchentwicklung in / aus Gebäude unklar"/> </Row> </Table> ]] local parser = xml2lua.parser(handler) parser:parse(xml) |
...
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
local xml2lua = require("xml2lua") local incidents = { Table = { _attr = { name='Einsatzdaten' }, Data = { { _attr={ type='STRING', header='Einsatznummer' } }, { _attr={ type='STRING', header='Einsatzstichwort' } }, { _attr={ type='STRING', header='Meldebild' } } }, Row = { Column = { { _attr={ value='1234567890' } }, { _attr={ value='B2.5' } }, { _attr={ value='Rauchentwicklung in / aus Gebäude unklar' } } } } } } print("Incidents\n") xml2lua.printable(people) print() print("Incident Representation\n") print(xml2lua.toXml(incidents, "incidents")) |
...