http://qs321.pair.com?node_id=249271


in reply to SQL -> XML Conversion

There is a very good reason for the current behaviour: NULL gets mapped to no element, empty string gets mapped to empty element.

If you really need to confuse the two concepts, you can write a SAX filter (put it between the generator and your consumer) which fills in the missing elements.

On a side note: if you need a CSV, why are you passing through XML?

-- 
        dakkar - Mobilis in mobile

Most of my code is tested...

Perl is strongly typed, it just has very few types (Dan)

Replies are listed 'Best First'.
Re: Re: SQL -> XML Conversion
by set_uk (Pilgrim) on Apr 09, 2003 at 22:06 UTC
    I agree it appears confused. My theory was to query the db once - convert to XML then use multiple XSLT passes to build whatever output format I needed be it HTML, CSV or different XML format. It works ok - but the important thing is that I now know a hell of a lot more than when I started

      If you need them to be distributed by a web server, you could give AxKit a try. AxKit comes with the AxKit::XSP::ESQL taglib that you could use to query the database and output XML at your pleasure -which you could them make available as an HTML page or whatever format you like.

      If you are interested in AxKit and the ESQL taglib you could also take a look at this article: Fun with ESQL.

      Ciao!
      --bronto


      The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
      --John M. Dlugosz