On 9/20/07, Milo Thurston <knirirr / gmail.com> wrote:
> Alex LeDonne wrote:
> > Note that there should be no </xml> - the line at the top is a
> > declaration, not an opening tag. Where did </xml> come from? What
> > happens if you remove that from the data?
>
>
> Good point about the XML. Unfortunately, these are the files I have
> received and have to deal with them for now.
>
> Removing the final tag gives:
>
> .file.xml:3: parser error : Extra content at the end of the document
> <server_name>myserver.edu</server_name>
> ^
> rake aborted!

You should have done two things: 1. add root node <server> (with
closing </server> just before </xml>) AND 2. remove the trailing
</xml>

Then it'll be fine.

in your case it's easy:

data.gsub('?>', '?><server>').gsub('</xml>', '</server>')