1

I would like to generate a graphical documentation of some XSD files (XML schema definition). I know, there are a few projects that do a good job generating a textual documentation. But I use XmlSpy and I really love the tree that I get when I click on "print".

I would like to generate this automatically on a continuous integration server. The question is: how can I get this scripted? I found a forum post that sais "it's possible", but I don't have a clue where to start.

EDIT: the focus here is doing it from the command line rather than having a graphical editor.

Community
  • 1
  • 1
Stefan Bormann
  • 643
  • 7
  • 25
  • 1
    possible duplicate of [How to visualize an XML schema?](http://stackoverflow.com/questions/2486758/how-to-visualize-an-xml-schema) – Abel Sep 14 '15 at 13:46
  • @Abel: I guess, yes, I missed that question in my attempts to search for an existing question. I don't understand that question well enough on whether automation was the goal. – Stefan Bormann Sep 15 '15 at 08:04

3 Answers3

3

Some ideas:

  • You may like Xsdvi, which converts an input XSD into an SVG diagram like this one (which I think is a logical choice: it's an XML to XML conversion). It is simple to use and its output can be rendered to any scale, it is SVG after all.

  • This tool was mentioned in this off-topic and deleted post (requires 20k+ rep to view). And there's XSDiagram, check it out.

  • Apparently, JDeveloper can be used for this, as this post shows, which is free for registered users.

I have not tried any of these, I'm happy with what oXygen provides. Try them out. Be aware that asking for tools is typically off-topic on StackOverflow, though continuous-integration is not (hence I decided to answer anyway).

Community
  • 1
  • 1
Abel
  • 56,041
  • 24
  • 146
  • 247
0

You can also use the stylesheets from the XS3P project. You can apply them using a standard XSLT transformation engine (Saxon...).

Clemens
  • 1,744
  • 11
  • 20
0

Thanks to @Abel for pointing me to XSD Diagram. Since version 1.0 this program can also write the annotations into the generated image.

I am using it in the following way now:

XSDDiagramConsole.exe -o picture.png -r rootnode -d -y -e 10 schema.xsd
Stefan Bormann
  • 643
  • 7
  • 25