in reply to Re: XML::Parser SAX error
in thread XML::Parser SAX error

i just created a simple is-well-formed script and it passed as well-formed. I also tried with this code snippet as an xml file

<?xml version="1.0" encoding="utf-8"?> <file Catid="0011" Date_added="20050910000000" HighPic="photo/location +.jpg" HighPicHeight="123" HighPicSize="1122" HighPicWidth="123" Model +="varchar model name" On_Market="0" Prod_ID="varchar id name" Product +_I="111" Product_View="11223" Quality="qualitylevel" Supplier="x" Upd +ated="20110713144032" path="required/path/to/other.doc"></file>

it too is giving me a not well-formed error.

Replies are listed 'Best First'.
Re^3: XML::Parser SAX error
by graff (Chancellor) on Jul 16, 2011 at 06:04 UTC
    So, I think the problem is you need to check the man page for XML::Parser. You're passing a file name to the "parse()" method, but you should be passing the file name to the "parsefile()" method. ("parse()" is expecting its argument to be an xml string or a file handle that you've already opened, not a file name.)

    (update: apart from the lesson you've learned now about posting valid sample data, let me also suggest that you trim your code down to the minimal snippet needed to demonstrate the problem. I had to filter out all that database crud to see the error for myself, and only then did I realize that you were using the wrong method call.)

      I'm sorry about that. I just didn't want somebody to not see something and inquire upon that as well and waste their time. Turns out I was wasting time anyway. My bad.
Re^3: XML::Parser SAX error
by bcnagle (Novice) on Jul 16, 2011 at 05:33 UTC
    oh just realized those dashes are created from the tree (expand) and not actually in the file. sorry for the confusion.