0

How do i extract data from an xml file and store them into data structures in my code to use them? I might be using java or c for my coding but i need to extract data from an xml file conveniently to go ahead

Aravind.HU
  • 9,194
  • 5
  • 38
  • 50
  • possible duplicate of [Parsing XML files using CodeIgniter?](http://stackoverflow.com/questions/4259688/parsing-xml-files-using-codeigniter) – raina77ow Oct 10 '12 at 11:48
  • Needs to be retagged as java because the statement of posting says "I might be using java or c" – Aravind.HU Oct 10 '12 at 11:50

2 Answers2

1

If your XML files have a corresponding schema (or schemas), then the easiest way is to use JAXB to generate Java classes that can be used for both marshallng (turning Java objects into XML) and unmarshalling (read XML into Java objects).

Even if you don't have a schema, it is still worthwhile, but in this case you have to manually create and annotate the Java classes that corresponds to your XML structure.

forty-two
  • 12,204
  • 2
  • 26
  • 36
0

Well, as one of the possible options you can use SimpleXML, there is a great amount of documentation available on the official PHP website. Examples included.

Sergey Telshevsky
  • 12,077
  • 6
  • 55
  • 78