473,503 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Xpath expressions and queries? How do I do this?

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.
Nov 12 '05 #1
2 1003
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


Nov 12 '05 #2
its ok, I got over this idea...pleading temporary insanity for even trying
to go there. -hazz

"hazz" <gr*********@nospamcomcast.net> wrote in message
news:e%****************@TK2MSFTNGP14.phx.gbl...
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

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
8282
by: Scott Simpson | last post by:
What is a good tool for running XPath queries on Linux? I have the O'Reilly XPath book and I'm using XPath Visualizer on Windows and that seems to work fine, but I'm looking for something on Linux....
1
1230
by: gimme_this_gimme_that | last post by:
I have the following xml file and need some tips on xpath queries to fetch the data. I think I'm not handling namespaces correctly. Here is xml file : <?xml version="1.0"...
4
8948
by: Gismo | last post by:
I have got file raport.rld which is an XML file generated by MS Reporting Services. The problem is: in this file are tags from two different namespaces ...
2
2859
by: ree32 | last post by:
When I import an xml document in Visual studio and Genereate as schema from it, and create a dataset from it, it adds this line into to the root element of my xml file -...
2
7729
by: Echo 8 | last post by:
Is there a simple way of compare dates? I am trying to create a list of perishable stock in an inventory that is near or past its expiration date. I've tried telling it to compare a node's value...
10
2271
by: Michael C# | last post by:
OK, here's the deal. I have a small XML file that represents a small database table. I load it into a System.XML.XMLDocument. So far so good. I run an XPath query against it to retrieve all the...
0
1834
by: rsotolongo | last post by:
I need generate randoms XPath expressions to make queries to XML documents. Someone can help me to find a component (class) that auto generate XPath expressions???. Maybe, someone can say me...
1
4152
by: rsotolongo | last post by:
I need generate randoms XPath expressions to make queries to XML documents. Someone can help me to find a component (class) that auto generate XPath expressions???. Maybe, someone can say me...
1
2670
by: Arndt Jonasson | last post by:
The way I read the XPath 1.0 specification, queries like "//*/ text()/.." and "//*/child::text()" should be valid. xmllint seems to agree with me, but xsltproc gives syntax errors for those...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.