dom\GetElementsByTagName.java - Apache Xerves DOM Sample

Q

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

✍: FYIcenter

A

dom\GetElementsByTagName.java provided in the Apache Xerces package illustrates how to use the Document#getElementsByTagName() method to quickly and easily locate elements by name.

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

>\fyicenter\jdk-1.8.0\bin\java 
   -cp \fyicenter\xerces-2_11_0\xercesSamples.jar dom.GetElementsByTagName

usage: java dom.GetElementsByTagName (options) uri ...

options:
  -p name     Select parser by name.
  -e name     Specify element name for search.
  -a name     Specify attribute name for specified elements.
  -n | -N     Turn on/off namespace processing.
  -v | -V     Turn on/off validation.
  -s | -S     Turn on/off Schema validation support.
              NOTE: Not supported by all parsers.
  -f  | -F    Turn on/off Schema full checking.
              NOTE: Requires use of -s and not supported by all parsers.
  -hs | -HS   Turn on/off honouring of all schema locations.
              NOTE: Requires use of -s and not supported by all parsers.
  -va | -VA   Turn on/off validation of schema annotations.
              NOTE: Requires use of -s and not supported by all parsers.
  -dv | -DV   Turn on/off dynamic validation.
              NOTE: Not supported by all parsers.
  -xi | -XI   Turn on/off XInclude processing.
              NOTE: Not supported by all parsers.
  -xb | -XB   Turn on/off base URI fixup during XInclude processing.
              NOTE: Requires use of -xi and not supported by all parsers.
  -xl | -XL   Turn on/off language fixup during XInclude processing.
              NOTE: Requires use of -xi and not supported by all parsers.
  -h          This help screen.

defaults:
  Parser:     dom.wrappers.Xerces
  Element:    *
  Namespaces: on
  Validation: off
  Schema:     off
  Schema full checking:            off
  Honour all schema locations:     off
  Validate annotations:            off
  Dynamic:    off
  XInclude:   off
  XInclude base URI fixup:  on
  XInclude language fixup:  on

 

Verify XML Element Name with dom\GetElementsByTagName.java

XML Schema Validaiton with dom\Writer.java

Using Apache Xerces DOM Sample Programs

⇑⇑ FAQ for Apache Xerces XML Parser

2017-11-11, 33415🔥, 0💬