I want to generate graph from large xml files. It is actually a calling context tree generated by an execution of the program. A small file looks like below:
From this xml I would like to have a graph which Contains 4 nodes(one node for each method tag) i.e. main, methodA, methodB and method C. As the tree shows (from the indentation) main() calls methodA, then methodA calls methodB and methodC. So the I want a graph'/figure like something like below:
Are there any open source tools which can do this for me ? The xml files are extremely large (around 7 MB) so the graph would really be huge. I want the tool to handle this properly. It is good if the tool works on linux otherwise on windows will also be ok. But first preference is linux.
I can also consider some good library in java through which I can do this.
Thanks.
You can view XML files in different ways including using a text editor, like Notepad or TextEdit, a web browser like Safari, Chrome, or Firefox, or an XML viewer. Open your text editor or XML viewer, then open your XML to view it. Drag and drop the XML file to your web browser to view it.
An XML document is a tree, which is a particular sort of directed graph.
General applications: XML provides a standard method to access information, making it easier for applications and devices of all kinds to use, store, transmit, and display data.
My suggestion would be yEd - it is not open source, but free and cross-platform (Java-based and works amazingly smooth on Linux with Oracle's JDK) and uses open standards for input/output. It is capable of visually arranging networks with thousands of nodes and has an import tool that can read xml files. Since there is no single best way to import an xml file into a graph structure, you can associate an XSLT file and convert the input to GraphML - yEd can automatically apply the XSLT file to your xml file and then calculate a nice drawing that can then be analyzed or exported.
Here are links to some XSL example stylesheets that you can use as a basis.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With