in reply to XML::Parser and multiple results

Hmm, I don't think  <output 2> is a valid element in XML. Whitespace is used to separate the element from attributes and 2 is not a valid attribute.

XML elements must follow these naming rules:

Names can contain letters, numbers, and other characters Names must not start with a number or punctuation character Names must not start with the letters xml (or XML or Xml ..) Names cannot contain spaces

So it would be best to fix the XML first.

-Mark

Replies are listed 'Best First'.
Re: Re: XML::Parser and multiple results
by Ineffectual (Scribe) on Feb 19, 2004 at 01:15 UTC
    I was giving example elements and not real elements. The XML is correctly formed other than the fact that there are multiple results in the same file. Each Output on its own is a valid file. I don't really want to pollute my filesystem with 46k -> 100k individual files that are clunky to move around, so I'm trying to figure out if there's a way to parse one file instead of splitting each output into its own file. From what I can see from the responses, the only way would be to have perl split the big file into a hash or array and feed that into XML::Parser as individual "files"... Does this seem to be correct?

    Ineff
        So I tried this solution, unfortunately each of the outputs contains an <?xml definition that screws up the parser because it should be at the beginning of a single file and not in the middle of a file. So I guess I'll split out each file that should be separate and do it that way. Thanks for the help. Ineff

      Does this XML need to validate against a schema? If not, could you prepend an opening tag and append a closing tag, wrapping multiple nodes in one parent node?

      From what I can see from the responses, the only way would be to have perl split the big file into a hash or array and feed that into XML::Parser as individual "files"... Does this seem to be correct?
      No, it is perfectly valid to have any number of tags there. If your output is valid. But XML::Parser stops, so I doubt it is valid.
      Boris