How to visualize a set of interconnected XML objects?

I have some XML documents that, roughly simplified, can be described as:

<someobject id="mykey">
  <relatedobject id="hiskey"/>
  <relatedobject id="herkey"/>
</someobject>
<someobject ...

What would be an easy way to create a diagram of this, showing objects placed in a 2D space, with lines between them?

I really like XSLT and Xpath, but will prefer a solution that does not require writing a program from scratch. Having made several command line calls in Saxon, then the program creating the graph will be fine. Bonus points for everything you can do with online tools. Extra bonus points for a live (e.g. javascript) interactive chart.

+3
source share
3 answers

, , GraphViz Philipp. xmlstarlet, XSLT .

( echo "graph G {" 
  xmlstarlet sel -t -m "//someobject/relatedobject" \
    -v "concat(../@id, ' -- ', @id, '&#xa;')" input.xml 
   echo "}" ) | dotty -

:

alt text


: SVG, - , Dracula Graph Library W3C XSLT. XSLT ( - ). , , .

+3

GraphViz: , XSLT, . .

,

graph G { 
  mykey -- hiskey
  mykey -- herkey
}

.

+2

. XML-, . , , - . , , , , . , , , .

http://media4.obspm.fr/outils/clustering/doc_en.html

0

Source: https://habr.com/ru/post/1779325/


All Articles