shug94 has asked for the wisdom of the Perl Monks concerning the following question:
Error: “Aug 5, 2009 4:53:55 PM org.apache.catalina.core.ApplicationCon +text log INFO: cgi: runCGI (stderr):no element found at line 1, column 0, byte +-1 at C:/Perl/lib/XML/Parser.pm line 187”
use XML::Parser; $filterXSDFilename = 'data/ppp-sbg-types.xsd'; if(open(FILTER_XSD_FILE, $filterXSDFilename)) { print "Content-type: text/html\n\n"; @xsdFileContentsArray = <FILTER_XSD_FILE>; print "The array is: " . @xsdFileContentsArray; print "File Length in lines: " . $xsdFileContentsArray; $xsdFileContentsAsScalar = concatenateXSDFileContents(@xsdFileConten +tsArray); my $parser = new XML::Parser(Handlers => { Start => \&handleStartTag, End => \&handleEndTag, Char => \&handleCharacterStrings, Default => \&handleDefault,}); $parser->parse($xsdFileContentsArray); print ("A RetrieveEventHistoryRequest has been generated.<P><P>"); } else { print "Content-type: text/html\n\n"; print ("A RetrieveEventHistoryRequest has not been generated.<P><P>" +); print ("<HR><P><P>"); print ("There was an error loading the following xsd file: " . $filt +erXSDFilename . "<BR>"); } #Params are an array of the lines of the xsd file. sub concatenateXSDFileContents (@) { @lines = @_; $lineSize = @lines; print $lineSize; print "<BR>\n"; $index = 0; $returnString = ""; while($index < $lineSize) { $returnString .= $lines[$index]; $index++; } return $returnString; } sub handleStartTag($$%) { my ($expat, $element, %attributeList) = @_; print "StartTag - Element Name: $element"; } sub handleEndTag() { } sub handleCharacterStrings() { } sub handleDefault() { }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Parser Issues
by shug94 (Sexton) on Aug 06, 2009 at 02:36 UTC | |
by apl (Monsignor) on Aug 06, 2009 at 13:02 UTC |