Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^3: nested loops and escaping in XML::Generator

by Tanktalus (Canon)
on Jul 12, 2006 at 21:48 UTC ( [id://560832] : note . print w/replies, xml ) Need Help??

in reply to Re^2: nested loops and escaping in XML::Generator
in thread nested loops and escaping in XML::Generator

Ok, that's extremely helpful information. The data format is a "I wanna slap the guy who forced this on the world" answer. I can accept that. There are many people I know who deserve slapping. Of course, I say this with a severe Captain-Jack-Sparrow accent ;-)

The first part of your node, however, is really helpful. I didn't understand the problem at first. Now, however, it looks like you want to do this (based only on the docs, not on trying it myself):

use XML::Generator escape => 1; $generator->imageinfo( \$imageSection );
To me, this seems like a reasonable tradeoff. You're saying, "Trust me, this is valid XML here." And you're right - it is. Other than abandoning XML::Generator, this seems like your best option. You get escaping most of the time (which is what you should want), and can override it in the rare circumstance where you really want to.

Personally, I wouldn't have used XML::Generator, but XML::Twig, based on my XML decision tree. But the wonderful thing about Perl is that there's so many ways to do things - do it the way that makes the most sense to you ;-)

Replies are listed 'Best First'.
Re^4: nested loops and escaping in XML::Generator
by geektron (Curate) on Jul 13, 2006 at 14:38 UTC
    Passing \$imageSection isn't something I'd thought of. I'll give it a shot.

    XML::Twig *looked* a little less straightforward and whatnot to me ... I just want to spit the XML out, not parse it. That's someone else's job (this annoying 3rd party), and as long as I can spit out something in his (company's) format, I'm safe.