Properties

Properties are in many ways similar to features, and there are equivalent methods for getting and settings properties. The subtle difference is that properties are changing characteristics, such as the current text string that triggered the latest event. They are mostly read-only, and the properties can be accessed as strings or objects.

Get and set properties

It is possible to ask the parser in a standard way what properties it has, using the getProperty method. This method returns an object that represents the property:

Object property = mySAXParser.getProperty( URL );

The setProperty method is called with two parameters. The first parameter names a property. The second parameter switches the feature on or off using a boolean value ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.