[XML-SIG] pyxml wants Internet connection?
Gary Robinson
grobinson at transpose.com
Mon Jun 9 22:35:40 EDT 2003
Dear Martin (and other xml-siggers):
A while back (May 27), Martin made a suggestion on this list to enable me to
do xml parsing when I'm not connected to the Internet. The problem was that
the xml file in question had the line:
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
and it was apparently looking for the Apple site even when I wasn't
connected.
Martin said:
> I see. After invoking the parser's reset, and before invoking feed, you
> need to invoke
>
> parser._parser.SetParamEntityParsing(xml.parsers.expat.XML_PARAM_ENTITY_PARSIN
> G_NEVER)
But the following code doesn't work:
from xml.sax import make_parser
import xml.parsers.expat
myparser = make_parser()
myparser._parser.SetParamEntityParsing(xml.parsers.expat.XML_PARAM_ENTITY_PA
RSING_NEVER)
It gets the error: "AttributeError: 'NoneType' object has no attribute
'SetParamEntityParsing'"
If I replace the last line above with:
myparser.SetParamEntityParsing(xml.parsers.expat.XML_PARAM_ENTITY_PARSING_NE
VER)
I get the error:
"AttributeError: ExpatParser instance has no attribute
'SetParamEntityParsing'"
If you have any ideas for how to get this working I'd really appreciate it!
Many thanks--
--Gary
--
<http://ThisURLEnablesEmailToGetThroughOverzealousSpamFilters.org>
Gary Robinson
CEO
Transpose, LLC
grobinson at transpose.com
207-942-3463
http://www.transpose.com
http://radio.weblogs.com/0101454
> From: "Martin v. Löwis" <martin at v.loewis.de>
> Date: Tue, 27 May 2003 14:51:08 +0200
> To: Gary Robinson <grobinson at transpose.com>
> Cc: "xml-sig at python.org" <xml-sig at python.org>
> Subject: Re: [XML-SIG] pyxml wants Internet connection?
>
> parser.SetParamEntityParsing
More information about the XML-SIG
mailing list