Let me state up front that I know very little about XML. My experience is
pretty much limited using the XML Serializer to serialize a user preferences
class to a file and back again.
I'm writing a rules engine for an application that basically involves
allowing the user to enter the the WHERE clause for a SQL Server query that
becomes the rule. The rules will be stored in a SQL Server database and the
user will be able to make changes to the rules. The rules are entered through
a non-freeform interface, so I don't have to try and parse the rule after the
user enters it. However, when I retrieve the rule from the database I will
need to identify the parts of the rule to properly repopulate the interface.
My first thought was that i would have to create my own syntax to represent
the rule and write code to parse the result but then I thought XML was
supposed to be good at that sort of thing. So I started reading about XSD
schemas hoping to create something that I could use to create an string
containing the rule that I could write into the database and the opposite.
I started trying to create an XSD schema for the rules and then I looked at
the recursive definition of a SQL WHERE clause and figured I'd better ask for
advice.
I did a Google search for an XSD schema for a SQL Server query and came up
with nothing.
Is XML the correct tool for my problem?
Does anyone know where I can get an XSD schema for either a SQL query or the
WHERE clause?
How do I handle the recursive definition of the WHERE clause in an XSD schema?
Is there a better way to approach my problem?
Thanks,
Bob