sax\Writer.java - Apache Xerves SAX Sample

Q

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

✍: FYIcenter

A

sax\Writer.java provided in the Apache Xerces package illustrates how to register a SAX2 ContentHandler and receive the callbacks in order to print a document that is parsed.

Here is how to run sax\Counter.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 sax.Writer

usage: java sax.Writer (options) uri ...

options:
  -p name     Select parser by name.
  -n  | -N    Turn on/off namespace processing.
  -np | -NP   Turn on/off namespace prefixes.
              NOTE: Requires use of -n.
  -v  | -V    Turn on/off validation.
  -xd | -XD   Turn on/off loading of external DTDs.
              NOTE: Always on when -v in use and not supported by all parsers.
  -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.
  -ga | -GA   Turn on/off generation of synthetic 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.
  -c | -C     Turn on/off Canonical XML output.
              NOTE: This is not W3C canonical output.
  -h          This help screen.

defaults:
  Parser:     org.apache.xerces.parsers.SAXParser
  Namespaces: on
  Prefixes:   off
  Validation: off
  Load External DTD: on
  Schema:     off
  Schema full checking:     off
  Dynamic:    off
  Canonical:  off
  Honour all schema locations:       off
  Validate Annotations:              off
  Generate Synthetic Annotations:    off
  XInclude:   off
  XInclude base URI fixup:  on
  XInclude language fixup:  on

 

JAR Files Required to Run sax\Writer.java

JAR Files Required to Run sax\Counter.java

Using Apache Xerces SAX Sample Programs

⇑⇑ FAQ for Apache Xerces XML Parser

2017-10-23, 23496🔥, 0💬