??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 175
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 176
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 177
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 178
ó
0•’hc @ sm d Z d Z d Z d d l Z d d l Z e j d d k r{ e j e ƒ d Z e e f Z e j
d ƒ d Z d „ Z n e Z d
„ Z d d l
Td d l m Z m Z d d
l m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z y d d l Z Wn+ e k
r-e d e j ƒ d ƒ ‚ n Xd e j f d „ ƒ YZ d e j! f d „ ƒ YZ" d „ Z# d S( sí A SAX2 driver for libxml2, on top of it's XmlReader API
USAGE
# put this file (drv_libxml2.py) in PYTHONPATH
import xml.sax
reader = xml.sax.make_parser(["drv_libxml2"])
# ...and the rest is standard python sax.
CAVEATS
- Lexical handlers are supported, except for start/endEntity
(waiting for XmlReader.ResolveEntity) and start/endDTD
- Error callbacks are not exactly synchronous, they tend
to be invoked before the corresponding content callback,
because the underlying reader interface parses
data by chunks of 512 bytes
TODO
- search for TODO
- some ErrorHandler events (warning)
- some ContentHandler events (setDocumentLocator, skippedEntity)
- EntityResolver (using libxml2.?)
- DTDHandler (if/when libxml2 exposes such node types)
- DeclHandler (if/when libxml2 exposes such node types)
- property_xml_string?
- feature_string_interning?
- Incremental parser
- additional performance tuning:
- one might cache callbacks to avoid some name lookups
- one might implement a smarter way to pass attributes to startElement
(some kind of lazy evaluation?)
- there might be room for improvement in start/endPrefixMapping
- other?
s Stéphane Bidoul s 0.3iÿÿÿÿNi i t utf8i c C s" | d k r | St | ƒ d Sd S( Ni ( t Nonet _decoder( t s( ( sA /opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt _d1 s c C s | S( N( ( R ( ( sA /opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyR 9 s ( t *( t xmlreadert saxutils(
t feature_namespacest feature_namespace_prefixest feature_string_interningt feature_validationt feature_external_gest feature_external_pest property_lexical_handlert property_declaration_handlert property_dom_nodet property_xml_strings+ libxml2 not available: import error was: %st Locatorc B s; e Z d Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( s4 SAX Locator adapter for libxml2.xmlTextReaderLocatorc C s
| | _ d S( N( t _Locator__locator( t selft locator( ( sA /opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt __init__S s c C s d S( s6 Return the column number where the current event ends.iÿÿÿÿ( ( R ( ( sA /opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt getColumnNumberV s c C s
| j j ƒ S( s4 Return the line number where the current event ends.( R t
LineNumber( R ( ( sA /opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt
getLineNumberZ s c C s d S( s3 Return the public identifier for the current event.N( R ( R ( ( sA /opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt getPublicId^ s c C s
| j j ƒ S( s3 Return the system identifier for the current event.( R t BaseURI( R ( ( sA /opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt getSystemIdb s ( t __name__t
__module__t __doc__R R R R R ( ( ( sA /opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyR P s t
LibXml2Readerc B sb e Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z
d „ Z RS(
c C s\ t j j | ƒ d | _ d | _ d | _ d | _ d | _ d | _ d | _
d | _ d S( Ni i ( R t XMLReaderR t _LibXml2Reader__nst _LibXml2Reader__nspfxt _LibXml2Reader__validatet _LibXml2Reader__extparamst _LibXml2Reader__parsingR t _LibXml2Reader__lex_handlert _LibXml2Reader__decl_handlert _LibXml2Reader__errors( R ( ( sA /opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyR h s c C sG | j d k r g | _ n | j j | t | d t | ƒ ƒ f ƒ d S( N( R) R t appendt SAXParseExceptionR ( R t argt msgt severityR ( ( sA /opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt
_errorHandlerw s
c C s’ x‚ | j D]w \ } } | t j t j f k rA | j j | ƒ q
| rq | | j d d k rq | j j | ƒ q
| j j | ƒ q
Wd | _ d S( Niÿÿÿÿi ( R) t libxml2t PARSER_SEVERITY_VALIDITY_WARNINGt PARSER_SEVERITY_WARNINGt _err_handlert warningt
fatalErrort errorR ( R t fatalR. t exception( ( sA /opt/cpanel/ea-libxml2/lib/python2.7/site-packages/drv_libxml2.pyt
_reportErrors~ s c C sC d | _ z)t | t ƒ r- t j | ƒ } nZ t j | ƒ } | j ƒ } | d k rc | j ƒ } n t j
| ƒ } | j | j ƒ ƒ } | j
| j d ƒ | j rõ | j t j d ƒ | j t j d ƒ | j t j d ƒ | j t j | j ƒ n | j t j d ƒ | j r&t j i i ƒ } n t j i ƒ } g } | j j ƒ xÀ| j ƒ } | d k r…| j d k rê| j d ƒ qêne | d k r´| j d k r°| j d ƒ n Pn6 | j d k rÓ| j d ƒ n | j j t! d ƒ ƒ P| j" ƒ } | d k rB| j r©t# | j$ ƒ ƒ t# | j% ƒ ƒ f }
t# | j&