2013-02-16 14 views

risposta

5

Uso LaTeX per creare la rappresentazione DOM.

Ecco un esempio di lavoro minima:

\documentclass{scrreprt} 
\usepackage{tikz-qtree} 
\begin{document} 

    \Tree[.table 
     [.thead 
      [.tr 
      [.th [.\textit{Vorname} ] ] 
      [.th [.\textit{Nachname} ] ] 
      ] 
     ]    
     [.tbody 
      [.tr 
      [.td [.\textit{Donald} ] ] 
      [.td [.\textit{Duck} ] ] 
      ] 
     ] 
     ] 

\end{document} 

che dà:

enter image description here

3

Ho appena provato a utilizzare due librerie.

Per prima cosa ho convertito il DOM per JSON utilizzando Jsonml

var jsonData = JsonML.fromHTMLText(htmlData); 

poi utilizzato Json Editor o Json Viewer per visualizzarlo

Visualizza I campioni in jsFiddle

  1. Using Json Editor
  2. Using Json Viewer

Spero che questo possa aiutarti.

+1

l'url raw github non funziona. Dovresti cambiarlo. Vedi di più qui http://stackoverflow.com/a/18049842/815507 – Kunukn