Bad example in XRCTutorial?

Here's the first bit of the XRC file provided in the tutorial:

#design layout in a separate XML file
<?xml version="1.0" encoding="utf-8"?>
<resource>
   <object class="wxFrame" name="mainFrame">

Trying to load the file as provided doesn't generate any messages or exceptions, but the LoadFrame() method returns None, causing the first call to FindWindowById() to throw an AttributeError.

Changing the first line to an XML comment causes the same thing to happen. I don't know enough XML to decide if that's a bug in the parser, but I suspect that it is.

Placing an XML comment after the first line seems to work, as does deleting the <?xml version="1.0" encoding="utf-8"?> bit altogether.

Here's the link: http://wiki.wxpython.org/XRCTutorial

I'd fix it myself, but the page is locked.

Is the very first line of the file the commented line or the XML declaration?

I'm pretty sure the file must start with <?xml ...

···

On Sun, Aug 10, 2008 at 9:45 PM, Samwyse <samwyse@gmail.com> wrote:

Here's the first bit of the XRC file provided in the tutorial:

#design layout in a separate XML file
<?xml version="1.0" encoding="utf-8"?>
<resource>
<object class="wxFrame" name="mainFrame">

--
Josh English
Joshua.R.English@gmail.com

Josh English wrote:

Is the very first line of the file the commented line or the XML declaration?

I'm pretty sure the file must start with <?xml ...

You're undoubtedly correct. My point was that the example in the tutorial shows the line starting with that comment. Someone with write access needs to update the wiki.