0

I have an XML file stored in the SD card. It contains data like this:

<employees>
    <emp id="1" sex="male">
        <name>John</name>
        <age>36</age>
    </emp>
    <emp id="2" sex="female">
        <name>Marry</name>
        <age>28</age>
    </emp>
    <emp id="3" sex="male">
        <name>Phil</name>
        <age>30</age>
    </emp>
    <emp id="4" sex="male">
        <name>Frank</name>
        <age>33</age>
    </emp>
</employees>

I want convert it to string, like String str = "xml data".

How to do that?

Sufian
  • 6,405
  • 16
  • 66
  • 120
abcd1234
  • 219
  • 4
  • 16

1 Answers1

0

You need to open it with an XML document reader if you want the semantic content, but if you just want to read the string from a file then you just need a file reader which is dependent on your programming language.

For example in C# it would be File.ReadAllLines("myfile.xml").

Sufian
  • 6,405
  • 16
  • 66
  • 120
LordWilmore
  • 2,829
  • 2
  • 25
  • 30