Hi,
I have an XML "test.xml" file that I would like to manipulate using Basic4Android but am unsure of the best way to do this.
The XML file would be outputted from another system and would basically be a stock product ordering template. I want to be able to read this XML file into my application (using XML Sax Parser) which would then allow the user of the application to modify the orderqty for each item within the order file. I was thinking that I could display the result in a list view? Once the user had created their order (by indicating the qty of each item that they wanted to order) I wanted to be able to export the modified xml file back out of the application.
I was just wondering what the best way to approach this would be? I was thinking that I could parse the initial xml file into a SQLite database, manipulate the data and then build a modified xml file using the XMLBuilder library? Or alternatively I was wondering whether it would be possible to simply allow modification of the initial XML file without first parsing the data into the database?
So as an example, the input test.xml file would look like this:
My Application user would see a list containing a Label with the description for each item, followed by a text box allowing them to enter the orderqty that they wish to order for each item. For Example:
Label Enter Qty to order
Red Paint [4]
Blue Paint [8]
Yellow Paint [0]
The resulting output file test.xml would look as follows:
Any ideas on the best solution would be gratefully received.
Thank You
I have an XML "test.xml" file that I would like to manipulate using Basic4Android but am unsure of the best way to do this.
The XML file would be outputted from another system and would basically be a stock product ordering template. I want to be able to read this XML file into my application (using XML Sax Parser) which would then allow the user of the application to modify the orderqty for each item within the order file. I was thinking that I could display the result in a list view? Once the user had created their order (by indicating the qty of each item that they wanted to order) I wanted to be able to export the modified xml file back out of the application.
I was just wondering what the best way to approach this would be? I was thinking that I could parse the initial xml file into a SQLite database, manipulate the data and then build a modified xml file using the XMLBuilder library? Or alternatively I was wondering whether it would be possible to simply allow modification of the initial XML file without first parsing the data into the database?
So as an example, the input test.xml file would look like this:
B4X:
<?xml version="1.0"?>
<Orders>
<Item>
<garage>GARAGE1</garage>
<shelf>A01</shelf>
<description>Red Paint</description>
<id>20860</id>
<maxqty>10<maxqty>
<orderqty>0</orderqty>
</Item>
<Issue>
<garage>GARAGE1</garage>
<shelf>A02</shelf>
<description>Blue Paint</description>
<id>20861</id>
<maxqty>10<maxqty>
<orderqty>0</orderqty>
</Issue>
</Item>
<Issue>
<garage>GARAGE1</garage>
<shelf>A03</shelf>
<description>Yellow Paint</description>
<id>20862</id>
<maxqty>10<maxqty>
<orderqty>0</orderqty>
</Issue>
</Orders>
My Application user would see a list containing a Label with the description for each item, followed by a text box allowing them to enter the orderqty that they wish to order for each item. For Example:
Label Enter Qty to order
Red Paint [4]
Blue Paint [8]
Yellow Paint [0]
The resulting output file test.xml would look as follows:
B4X:
<?xml version="1.0"?>
<Orders>
<Item>
<garage>GARAGE1</garage>
<shelf>A01</shelf>
<description>Red Paint</description>
<id>20860</id>
<maxqty>10<maxqty>
<orderqty>4</orderqty>
</Item>
<Issue>
<garage>GARAGE1</garage>
<shelf>A02</shelf>
<description>Blue Paint</description>
<id>20861</id>
<maxqty>10<maxqty>
<orderqty>8</orderqty>
</Issue>
</Item>
<Issue>
<garage>GARAGE1</garage>
<shelf>A03</shelf>
<description>Yellow Paint</description>
<id>20862</id>
<maxqty>10<maxqty>
<orderqty>0</orderqty>
</Issue>
</Orders>
Any ideas on the best solution would be gratefully received.
Thank You