Groups | Blog | Home
all groups > dotnet xml > july 2005 >

dotnet xml : Xpath expressions and queries? How do I do this?



hazz
7/4/2005 6:28:18 AM
Does anyone have any ideas on how to implement what has been suggested for
my 'rules engine'? thx, -hazz

the following are rules in the sql server table, one row for each rule.
Table Column op value score
Buy Budget > 500000 10
Buy Budget < 500000 5
Sell In6mths = Yes 10
Sell In6mths = No 5

STEP 1 (SUGGESTION) Each rule consists of an XPath expression for the
operand, and operator, the value you
compare against, and the score.

If I have an object to evaluate against the above rules
Object to evaluate
CustomerID 1
Budget (Dollars) 10000
Sell (TimeFrame) 7 months
CustomerID 2
Budget (Dollars) 500001
Sell (TimeFrame) 3 months
CustomerID 3
Budget (Dollars) 600000
Sell (TimeFrame) 12 months

STEP 2 (SUGGESTION)
Bring theobjects above into my system and
serialize it (them) into an XML document. Then, apply each of the Xpath
queries to
the object, one at a time. If the query produces a result, you have a value
you can compare against. Apply the comparison and, if true, add the score
to your accumulated score.

hazz
7/5/2005 7:15:11 AM
posted this same question just now to sqlserver.xml newsgroup- how could I
create XPath expressions from the table column values
below so that I can use them in an XPath query.

RuleID PropertyToTest op value score
1 property1 > 500000 10
2 property1 < 500000 5
3 propertyboolean1 = Yes 10
4 propertyboolean1 = No 5

I will be applying the expressions created from the values above against
objects which have been serialized into an XML document, eg;

CustomerID 1
property1 10000
propertyboolean1 Yes
CustomerID2
property1 600000
propertyboolean1 No

If the expressions applied against the objects in the XML doc are true, the
score will be added to an accumulated score for each Customer.

Thank you very much for any help. -hazz



hazz
7/11/2005 9:01:56 AM
its ok, I got over this idea...pleading temporary insanity for even trying
to go there. -hazz

[quoted text, click to view]

AddThis Social Bookmark Button