[lxml-dev] Version 1.2.1 not working?
Roger Patterson
rogerpatterson at gmail.com
Wed Jul 11 22:25:39 CEST 2007
Hi Robert,
Firstly, you don't need to read your XML file into a string and then
convert it to a StringIO object. You can just feed the file handle to
etree.parse().
But other than that, your XML file parsed fine for me, and I'm using
lxml 1.2.1
You may want to make sure you've installed correctly.
-Roger
Robert Dailey wrote:
> Hi,
>
> I have the following Python code:
>
>
> from lxml import etree
> from StringIO import StringIO
>
> def loadXMLFile( filename ):
> f = open( filename, 'r' )
> xmldata = f.read()
> root = etree.parse( StringIO( xmldata ) )
> f.close()
> return root
>
>
> Python either crashes or hangs at the etree.parse() call. Below is the
> contents of the XML file I'm opening:
>
> <Page>
> <Frame type="Root">
>
> <!-- Check idle time for attract mode -->
> <OnIdleTime time="10000">
> <StartAttractMode dispatch="GAME"/>
> </OnIdleTime>
>
> <!-- Title Screen Image -->
> <Frame type="Image" value="Interface/Titlescreen.spr">
> <OnInput key="KEY_ACCEPT" require_focus="false">
> <!--<GoToPage dispatch="GUI" page="LeaderboardMenu"/>-->
> <GoToPage dispatch="GUI" page="MainMenu"/>
> <PlaySound dispatch="GAME" file="InterfaceSchwing"/>
> </OnInput>
> </Frame>
>
> </Frame>
> </Page>
>
> Anyone know why it isn't working? Thanks!
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> lxml-dev mailing list
> lxml-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/lxml-dev
>
More information about the lxml-dev
mailing list