Tech Off Post

Single Post Permalink

View Thread: Tough SQL Server XML Challenge
  • User profile image

    My experience with XSLT is that if you can understand it and it is at least Formatted correctly (tag hierarchy), you can write a declaritive StyleSheet to transform it into just about anything you want.  Depending on the complexity, this might not be better than a procedural analysis of the XML.

    Of course providing multiple voters as multiple XML blocks is totally stupid, and requires that you write at least SOME procedural code to break it up.

    I would suggest creating a format which is your objective (ie. one that will work), and then it should be pretty clear what kind of transformation needs to take place.  If it is not complicated, then it should be pretty easy to write an XSLT to take care of it, especially if you just need to change a couple of tag names.

    Regardless, it sounds like you won't be able to get away with directly importing it into SQL Server.


    ps. I didn't actually have time to examine the structure of the XML.  If you'd like me to make a more specific suggestion, let me know that you are interested in this kind of solution and what kind of changes need to take place.