Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate a dependency diagram from a set of XSD files?

See the title: I have around 50 XSD files importing each other (with tags) and I need to analyze their dependencies.

Do you know any software (preferably free) to generate a dependency diagram automatically from these files?

like image 743
julien Avatar asked Nov 30 '25 09:11

julien


2 Answers

I did not find any existing program to do that, so... I developed my own! It is called GraphVisu.

There is a first program to generate the graph structure from seed XSD files, and another one to visualise graphs. I also included a detection of clusters of interrelated nodes (called "strongly connected components" in graph theory).

Feel free to use it!

graph visualisation program GraphVisu

graph visualisation program GraphVisu

like image 95
julien Avatar answered Dec 03 '25 06:12

julien


I am not aware of any free solution tailored specifically for XSD. If I would have to build it using freely available components, I would probably consider GraphViz. You would need to write a module to generate the data needed by GraphViz which will come from parsing the XSD files. The latter is kind of trivial, if you take into account how schema location works and is resolved, and handle correctly circular dependencies. The good thing is that GraphViz is supported on a wide set of platforms, and as long as you can parse XML, you could be set.

I've also developed my own, in form of an XML Schema Refactoring (XSR) add-on for QTAssistant. This particular feature set has been around since 2004, so it works really well, including WSDL and XSD files.

I can interpret differently what you asked, so I'll refer to what you could do with XSR:

  • XSD files dependencies

QTAssistant showing ACORD 2.21 XSD file Layout

This is a simple one, showing a hierarchical layout.

QTAssistant showing Orbitz XSD file layout

This is a more complex one, showign an organic layout.

  • intra-XSD file schema components dependencies: can be filtered on arbitrary criteria (not sure what you meant by with tags).

QTAssistant showing intra-XSD file dependencies

  • XSD file set schema components dependencies (same as the above, but one can navigate across different files)

The tool comes with an automation library, where you can write a few lines of C# or Java script code which you can then invoke using QTAssistant shell or a command line shell to integrate it with an automatic build process.

Other features include the ability to export the underlying data using GraphML, that is if you wish to analyse or process the graph further (e.g. topological sorting, cycles, etc.)

like image 35
Petru Gardea Avatar answered Dec 03 '25 08:12

Petru Gardea



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!