问题
I have constructed a XML file and generated a XSD file from it. The XML is almost empty as there are elements but without value :
<parent>
<child1/>
<child2/>
</parent>
What I'm looking for is a soft that could convert my XML (or its associated schema) into a graphical representation as a tree :
parent
|
|
_______________________________
| |
| |
child1 child2
with cute boxes, colors and so on.
Any suggestion ? Thanks
回答1:
In general, it would be helpful to understand why you would be doing it for; for example, to author/analyse/validate the source (XML or XSD) and/or for documentation purposes? Then how do you plan on doing it? Interactive? Do you need automation to extract the visualizations?
A number of open source and free editions of commercial products provide some sort of XML and XSD visualization: Eclipse, NetBeans, Visual Studio (development tools), HelpStudio (help authoring), Oxygen, XmlSpy (specialized editors), etc.
QTAssistant (I am associated with it) also provides graphical representations of XML and XSD files; below are some examples.
XML visualized as a tree:

The associated (inferred) XSD:

The tools comes with an automation API that would allow one to constantly update these diagrams as the underlying XML/XSD changes.
回答2:
XSDDiagram, a small .NET 2.0 open source application can generate those diagrams.
http://regis.cosnier.free.fr/?page=XSDDiagram
来源:https://stackoverflow.com/questions/15955542/xml-xsd-graphical-representation-of-the-tree