home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

Book HomeJava and XSLTSearch this book

13.2. XML::Parser Methods

The following methods are defined by XML::Parser.



Constructor. Options are passed as keyword/value pairs. Recognized options are:

Sets the type of parser. The built-in styles are Debug, Subs, Tree, Objects, and Stream. Custom styles can be provided by giving a fully qualified package name containing at least one "::". This package must have subroutines defined for each parser type.

An anonymous hash containing the handler types as the keys with their associated values, which are references to subroutines for handling that type of event.

Some styles will refer to subroutines defined in the specified package.

The number of lines to show surrounding the line in which an error occurred.

Sets the protocol-encoding name (default is none). The built-in encodings are UTF-8, ISO-8859-1, UTF-16, and US-ASCII. You may introduce additional encodings by adding directories to @Encoding_Path.

If true, then namespace processing is done during the parse.

Normally, the parser will try to expand references to entities defined internally. If this option is true and a default handler is also set, then the default handler will be called when an entity reference is encountered.

A string for XML::Parser to interpret as end-of-file if found alone on a line. Useful when working with MIME multipart documents. The string should not contain a trailing newline.

Unless standalone is set to yes in the XML declaration, setting this to true allows the external DTD to be read, and parameter entities to be parsed and expanded.

If true, forces the use of a file-based external entity handler.

An anonymous hash whose keys are options that shouldn't be passed to Expat. This should be a concern only for those subclassing XML::Parser.

Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.