View XML Tree Structure with ui\TreeViewer.java

Q

How to view the tree Stucture of an XML document with the ui\TreeViewer.java provided in the Apache Xerces package?

✍: FYIcenter

A

If you want to view the tree Stucture of an XML document, you can try the ui\TreeViewer.java provided in the Apache Xerces package.

Compile and run ui\TreeViewer.java, if you have Apache Xerces 2.11.0 installed:

\fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\javac 
   -cp ..\xercesImpl.jar;..\xercesSamples.jar ui\TreeViewer.java

\fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\java 
   -cp .;..\xercesImpl.jar;..\xercesSamples.jar;..\xml-apis.jar 
   ui.TreeViewer User.xml

User.xml:
START createUI:User.xml
START refreshUI:User.xml
START getRoot:User.xml
START readXMLFileUser.xml
END readXMLFileUser.xml
END refreshUI:User.xml
END createUI:User.xml

You see a window displayed with the tree structure of the User.xml file:
Apache Xerces XML Tree UI Viewer

 

xs\QueryXS.java - Apache Xerves XS Sample

ui\TreeViewer.java - Apache Xerves UI Sample

Using Apache Xerces Other Sample Programs

⇑⇑ FAQ for Apache Xerces XML Parser

2017-09-12, 7992🔥, 0💬