Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: SQL -> XML Conversion

by dakkar (Hermit)
on Apr 09, 2003 at 15:54 UTC ( [id://249271]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-24 05:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found