SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL Result into XML per XSD?

    Hi and good morning developer-types!

    We need to take the results of a SQL query from MS SQL Server 7/2000 and format them to a XML schema document (.xsd). SQL 2000 has rudimentary XML support but you cannot, to my knowledge, format that automagically to a schema document. Plus we have to use older versions of MS SQL which do not have the same XML features. I was wondering if anyone had any ideas as to how to perform this? I'm not sure if this is a database question or a VB type one, but I figured I'd post it here first!

    I'm thinking the hardest part would be to figure out how to format the result set as defined per the XSD (the main part of the app anyway ).

    We're currently using VB6 and MS XML 4 for the path of least resistance, although probably we'll move to Java since this will have to be run on *nix environments, but for now I think I'm just trying to get an algorithm designed for the parsing -- once I understand how to do it, it should be easily portable to other languages.

    Any thoughts?

    Thanks,

  2. #2
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Milton Keynes, UK
    Posts
    1,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Matt, I've got no experience of XML schema documents so this may not be what you're looking for, but maybe of some help.

    Transforming ADO Recordsets to XML with XSLT

  3. #3
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shane,

    Thanks for the heads-up. Quite interesting; it appears to do *almost* what I need -- I may have to modify our process to make things easier!

    Thanks again!!

  4. #4
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Php has incredible support for xml from what I understand. So you may be able to do some of the processing via the db (would probably be faster) and then finish the job with a scripting language.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  5. #5
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well the problem is in taking semi-structured data (result set) and turning it into valid XML. It is currently very hard to do without special stuff. SQLXML from Microsoft will do the trick but it only runs on Windows!

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe this will help?
    http://www.bitflux.ch/developer/miscellaneous/67/

    I haven't tried it or read through the whole doc, but it looks useful.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •