1XML::SAX2Perl(3)      User Contributed Perl Documentation     XML::SAX2Perl(3)
2
3
4

NAME

6       XML::SAX2Perl -- translate Java/CORBA style SAX methods to Perl methods
7

SYNOPSIS

9        use XML::SAX2Perl;
10
11        $sax2perl = XML::SAX2Perl(Handler => $my_handler);
12        $sax->setDocumentHandler($sax2perl);
13

DESCRIPTION

15       "XML::SAX2Perl" is a SAX filter that translates Java/CORBA style SAX
16       methods to Perl style method calls.  This man page summarizes the
17       specific options, handlers, and properties supported by
18       "XML::SAX2Perl"; please refer to the Perl SAX standard "XML::SAX" for
19       general usage information.
20

METHODS

22       new Creates a new parser object.  Default options for parsing,
23           described below, are passed as key-value pairs or as a single hash.
24           Options may be changed directly in the parser object unless stated
25           otherwise.  Options passed to `"parse()"' override the default
26           options in the parser object for the duration of the parse.
27
28       parse
29           Parses a document.  Options, described below, are passed as key-
30           value pairs or as a single hash.  Options passed to `"parse()"'
31           override default options in the parser object.
32
33       location
34           Returns the location as a hash:
35
36             ColumnNumber    The column number of the parse.
37             LineNumber      The line number of the parse.
38             PublicId        A string containing the public identifier, or undef
39                             if none is available.
40             SystemId        A string containing the system identifier, or undef
41                             if none is available.
42
43       SAX DocumentHandler Methods
44           The following methods are DocumentHandler methods that the SAX 1.0
45           parser will call and "XML::SAX2Perl" will translate to Perl SAX
46           methods calls.  See SAX 1.0 for details.
47
48            setDocumentLocator(locator)
49            startDocument()
50            endDocument()
51            startElement(name, atts)
52            endElement(name)
53            characters(ch, start, length)
54            ignorableWhitespace(ch, start, length)
55            processingInstruction(target, data)
56

OPTIONS

58       The following options are supported by "XML::SAX2Perl":
59
60        Handler          default handler to receive events
61        DocumentHandler  handler to receive document events
62        DTDHandler       handler to receive DTD events
63        ErrorHandler     handler to receive error events
64        EntityResolver   handler to resolve entities
65        Locale           locale to provide localisation for errors
66        Source           hash containing the input source for parsing
67
68       If no handlers are provided then all events will be silently ignored,
69       except for `"fatal_error()"' which will cause a `"die()"' to be called
70       after calling `"end_document()"'.
71
72       If a single string argument is passed to the `"parse()"' method, it is
73       treated as if a `"Source"' option was given with a `"String"'
74       parameter.
75
76       The `"Source"' hash may contain the following parameters:
77
78        ByteStream       The raw byte stream (file handle) containing the
79                         document.
80        String           A string containing the document.
81        SystemId         The system identifier (URI) of the document.
82        PublicId         The public identifier.
83        Encoding         A string describing the character encoding.
84
85       If more than one of `"ByteStream"', `"String"', or `"SystemId"', then
86       preference is given first to `"ByteStream"', then `"String"', then
87       `"SystemId"'.
88

HANDLERS

90       The following handlers and properties are supported by "XML::SAX2Perl":
91
92   DocumentHandler methods
93       start_document
94           Receive notification of the beginning of a document.
95
96            Locator          An object that can return the location of any SAX
97                             document event.
98
99       end_document
100           Receive notification of the end of a document.
101
102           No properties defined.
103
104       start_element
105           Receive notification of the beginning of an element.
106
107            Name             The element type name.
108            Attributes       Attributes attached to the element, if any.
109
110           ALPHA WARNING: The `"Attributes"' value is not translated from the
111           SAX 1.0 value, so it will contain an AttributeList object.
112
113       end_element
114           Receive notification of the end of an element.
115
116            Name             The element type name.
117
118       characters
119           Receive notification of character data.
120
121            Data             The characters from the XML document.
122
123       ignorable_whitespace
124           Receive notification of ignorable whitespace in element content.
125
126            Data             The characters from the XML document.
127
128       processing_instruction
129           Receive notification of a processing instruction.
130
131            Target           The processing instruction target.
132            Data             The processing instruction data, if any.
133

AUTHOR

135       Ken MacLeod <ken@bitsko.slc.ut.us>
136

SEE ALSO

138       perl(1), XML::Perl2SAX(3).
139
140        Extensible Markup Language (XML) <http://www.w3c.org/XML/>
141        Simple API for XML (SAX) <http://www.megginson.com/SAX/>
142
143
144
145perl v5.16.3                      2003-10-21                  XML::SAX2Perl(3)
Impressum