We are currently developing a project in .NET that involves analyzing XML documents against a set of user defined rules. Here is an example:
<Person>
<Name>Bob</Name>
<Cars>
<Car Type="SUV" Color="Black"/>
<Car Type="Sports" Color="Red"/>
<Cars/>
</Person>
EG rules: if person's name = "Bob" and has 2 cars then ... if person has as least one SUV and at least one Sports car then ...
We are going to build a "rule builder" wizard that walks the users through the process of creating a rule. In addition to this, one of the other complications is that the schema of the XML documents will be dependent on customer needs so we need a quick way to adapt to new schemas. Can anyone provide some insight into what underlying technologies could best accomplish this? Here are a couple things we have considered:
- Dynamic Linq to XML
- Shredding XML into SQL tables and generate dynamic SQL statements
- Creating some type of custom DSL (Iron Python, Boo, etc)
Biggest concerns are ability to implement rules on the fly, speed, and easy/flexibility authoring the rules.
Ideas?