in reply to Re: Re: Re: Re: Using XML::Writer to create NITF files, but some tags exist in my data.
in thread Using XML::Writer to create NITF files, but some tags exist in my data.

Well, perhaps I should have been more specific. The idea I had in mind was that you would use one of these (or their XML cousins) to process your various data. Callbacks or the equivelent would trigger the XML writer to spit out a duplicate tag. As I said shouldnt be too difficult to code. My experience with HTML::Treebuilder suggests that you could use XML::Treebuilder and the function look_down with a code ref to do a simple callback that uses XML::Writer to achieve the desired results (and also allow you to validate the types of tag you allow to embedded).

A second approach (which I am hesitant to suggest, but you are an adult, even if an adult votebot :-) would be to use IO::Scalar as the type of OUTPUT parameter. That way you can do whatever you want to the string involved with little/no worry about what XML::Writer does behind doors.

Still, I think I would go with the callback if only out of sheer paranoia and future flexibility.

Yves / DeMerphq
--
Have you registered your Name Space?

  • Comment on Re: Re: Re: Re: Re: Using XML::Writer to create NITF files, but some tags exist in my data.

Replies are listed 'Best First'.
Callbacks with XML::Treebuilder / XML::Writer -- mini scratchpad...
by joealba (Hermit) on Dec 03, 2001 at 23:03 UTC
    Ooh.. I like the callback idea. I understand the general concept behind callbacks, but I've never actually used them before. If it works the way I think it might, I may have LOTS of other uses for them in other parts of my nasty parser!

    When I figure out the code, I'll post samples here -- after much SuperSearching...

    The votebot shall attain a new level of Perl wisdom today. Thanks, demerphq!