Git Product home page Git Product logo

xpath2dot's Introduction

XPath to GraphViz dot

Started as a question on Stack Overflow a couple of years ago but now gets used often enough to keep around.

Requirements:

Simple Usage:

Starting with a XML file which might change or go away from ftp://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/sample_xml/RCV000077146.xml

wget -q ftp://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/sample_xml/RCV000077146.xml

Which I will keep a snapshot of here.

xmlstarlet el -u RCV000077146.xml | xpath2dot.py | dot -T png > xpath2dot_demo.png
xmlstarlet el -v RCV000077146.xml | xpath2dot.py | dot -T png > xpath2dot_demo.png

Result:

Example xpath2dot output

More Usage:

Include XML attributes:

xmlstarlet el -a RCV000077146.xml | sort -u | xpath2dot.awk | dot -T png > xpath2dot_demo.png

Result:

Example xpath2dot with attributes output

Even More Usage:

Include XML name references:

xmlstarlet el -v RCV000077146.xml | xpath2dot.awk | dot -T png > xpath2dot_demo.png

Result:

Example xpath2dot with references output

xpath2dot's People

Contributors

tomconlin avatar zykure avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.