Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: XML::Parser and multiple results

by Ineffectual (Scribe)
on Feb 19, 2004 at 01:15 UTC ( [id://330108]=note: print w/replies, xml ) Need Help??


in reply to Re: XML::Parser and multiple results
in thread XML::Parser and multiple results

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

Replies are listed 'Best First'.
Re: Re: Re: XML::Parser and multiple results
by runrig (Abbot) on Feb 19, 2004 at 01:21 UTC
      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
Re: Re: Re: XML::Parser and multiple results
by chromatic (Archbishop) on Feb 19, 2004 at 01:21 UTC

    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?

Re: Re: Re: XML::Parser and multiple results
by borisz (Canon) on Feb 19, 2004 at 01:26 UTC
    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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://330108]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-03-28 12:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found