Table of Contents

 

Setting Properties

 

To set a property on either com.ibm.xml.parsers.SAXParser or com.ibm.xml.parsers.DOMParser, you should use the SAX2 Configurable interface (org.xml.sax.Configurable).

For example, to set the namespace separator property to "\" you, do:

DOMParser parser;

try {       
  parser.setProperty( "http://xml.org/sax/properties/namespace-sep",  
  "|");
}

catch (SAXException e) {
  System.out.println("error in setting up parser property");
}

General Properties

 

http://xml.org/sax/properties/namespace-sep

Type:

java.lang.String

Access:

read-write

Desc:

The separator string that will appear between the namespace URI and the local part of the name when namespace processing is being performed. If the value is the empty string, the two parts will be concatenated.

Default:

""

See:

http://xml.org/sax/features/namespaces (feature)

DOM Parser Properties

 

http://ibm.com/xml/properties/dom/current-element-node

Type:

org.w3c.dom.Node

Access:

read-only

Desc:

The current DOM element node while parsing.

Note:

This property is useful for determining the location with a DOM document when an error occurs.

See:

http://xml.org/sax/properties/dom-node

http://ibm.com/xml/properties/dom/document-class-name

Type:

java.lang.String

Access:

read-write

Desc:

The fully qualified class name of the DOM implementation. The implementation used must have a zero argument constructor.

Default:

"com.ibm.xml.dom.DocumentImpl"

Note:

When the document class name is set to a value other than the name of the default document factory, the deferred node expansion feature does not work.

See:

http://ibm.com/xml/features/dom/defer-node-expansion (feature)

SAX Parser Properties

 

http://xml.org/sax/handlers/DeclHandler

Type:

org.xml.sax.misc.DeclHandler

Access:

read-write

Desc:

Set the handler for DTD declarations.

http://xml.org/sax/handlers/LexicalHandler

Type:

org.xml.sax.misc.LexicalHandler

Access:

read-write

Desc:

Set the handler for lexical parsing events.

http://xml.org/sax/handlers/NamespaceHandler

Type:

org.xml.sax.misc.NamespaceHandler

Access:

read-write

Desc:

Set the handler for Namespace declaration scopes.