Python & XML

Matt Gerrans mgerrans at mindspring.com
Wed May 1 22:08:29 EDT 2002


I downloaded the examples for that book from the O'Reilly site and tried that
one out with Python 2.2 and PyXML 0.7 and it seemed to work okay, yielding the
following results:

D:\pythonxml_examples\c4>python po.py <po.xml
Sku: 229-987488
Sku: 228-988347
Sku: 221-388833

It may be a configuration issue or that you are using an older version of
either for which there is now a bug fix.   Getting Python and XML set up
properly can be a little messy, especially if you have more than one version
of Python installed.

- Matt

"Adonis" <deltapigz at telocity.com> wrote in message
news:3cd08936$1_3 at nopics.sjc...
> as in a prior post i was recommened to purchase the book Python & XML by:
> Christopher A. Jones & Fred L. Drake, Jr., which by the way is very
> informative and thank you for the person who recommended it to me, but it
> just happens that the majority if not all of the examples donot work, and i
> have copied it verbatim, and no luck, of course i tweaked some exmaples to
> work, but this one is beyond me and i have notbeen able to fix this:
>
> from xml.dom.ext.reader.Sax2 import FromXmlStream
> import sys
>
> doc = FromXmlStream(sys.stdin)
>
> for sku in doc.getElementsByTagName("sku"):
>     sku.normalize()
>     print "Sku: %s"%sku.firstChild.data
>
> keeps telling me im out of space?
>
> the example tells me to call it as "po.py < po.xml" but errors that. very
> frustrating when your trying to learn XML processing in python and the
> examples do not work! almot makes me feel my $30USD was not worth it. *sigh*
>
> any help would greatly be appreciated.
>
> Adonis
>
>





More information about the Python-list mailing list