06-12-2023 09:44 PM
Hello Everyone,
I'm trying to built an XML data as shown in the figure. The XML file will have a customized data which we required for our project.
Well, I've tried many ways which was not helping me till now. And i cannt obtain the XML result shown in the figure.
Here I attach my original code.
Kindly someone suggest to built such an XML file.
Thanks in Advance.
Regards
<?xml version="1.0" encoding="UTF-8" ?><bts version="1.0">
<cmd>inquire</cmd>
<list count = "1">
<inquire ip="127.0.0.1" devtype="25" devid="54" subdevid="1" chlid="1" aux="0">true</inquire>
</list>
</bts>
06-13-2023 08:25 PM
06-14-2023 12:49 AM
06-15-2023 12:25 PM - edited 06-15-2023 12:27 PM
Honestly there is nothing special about XML except for the header and tag rules it's just a text file.
Creating one just comes down to a bunch of String manipulation.
Right off the top of my head I would probably have the XML header and footer somewhat hard coded, maybe in a text file so they can be updated without code changes.
I would build a string for each line using the standard number to string methods if numeric values from the test must be inserted into the XML.
Then write each line to a text file as I go, save it with a .XML extension and you are done.
Don't worry about the indentation as that is just to make it more human readable.
06-15-2023 11:00 PM