|Keep It Simple, Stupid|
XML::Parser question.by reyjrar (Hermit)
|on Nov 04, 2002 at 18:55 UTC||Need Help??|
reyjrar has asked for the
wisdom of the Perl Monks concerning the following question:
Ok, I've been doing, network and database programming in perl for years now. I had a brief run in with HTML::Parser at some point in my career and it took me a _long_ time to grasp it. Now, I need to basically write a parser that follows XLinks and returns all the content in those documents to a parent document, essentially treating the XLinks as XIncludes. So, it seems simple and I'm 100% sure it is, I'm just not getting the XML Parsing modules. However, this is the 3rd different way I've tried this, and the 3rd time I've gotten this exact error mesasge from all three methods.
First I tried to use XML::SAX and write filters in a similar fashion to the way I read an article on xml.com to follow XIncludes. I get this error message:
so then I figure, "hey, I did it wrong, and I don't understand" So I search around some more, and find another article on xml.com about how to filter using XML::SAX::Machines. So I rewrite an implementation of my parser using XML::SAX::Machines, and alas the SAME error message.
So I spend all day debuging and get no where. I admit that I'm making things more complicated in attempting to understand the parser routines, and I thought I had a grasp of how they atleast functioned to gather information out of an xml document. I reread everything and attempt another implementation using XML::Parser.
The code follows ...
here is test.xml:
I get the same error as before, and I was wondering if some one could potentially correct my thinking on this simple example that it might shine some light on my dismal XML::Parser comprehension.