dom\ElementPrinter.java - Apache Xerves DOM Sample

Q

What is the dom\ElementPrinter.java provided in the Apache Xerces package? I have Apache Xerces 2.11.0 installed.

✍: FYIcenter

A

dom\ElementPrinter.java provided in the Apache Xerces package illustrates how to use the org.w3c.dom.ElementTraversal API.

Here is how to compile and run dom\ElementPrinter.java, if you have Apache Xerces 2.11.0 installed:

\fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\javac 
   -cp ..\xml-apis.jar dom\ElementPrinter.java

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

--> [User], Child Element Count = 4
----> [ID], Child Element Count = 0
----> [BirthDate], Child Element Count = 0
----> [Name], Child Element Count = 0
----> [Sex], Child Element Count = 0

 

Using Apache Xerces SAX Sample Programs

Verify XML Element Name with dom\GetElementsByTagName.java

Using Apache Xerces DOM Sample Programs

⇑⇑ FAQ for Apache Xerces XML Parser

2017-10-23, 12765🔥, 0💬