Search the web
Sign In
New User? Sign Up
xrules · XRules & DynamicDOM
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
a thank you and a question about string matching   Message List  
Reply | Forward Message #27 of 74 |
RE: [xrules] a thank you and a question about string matching

Mike,
Thanks for your nice words. The business rules space is quite large
and there are different tools and languages depending on what you need.
You could probably find a lot of tools if you search using the terms
"rules engine". However, to my limited knowledge, I'm not aware of a
rules language focused solely on XML the same way as XRules.

Your use of the <calculate> rule to replace strings is correct and
it should work just fine. In a future release of XRules there will also
be support for embedding JavaScript functions in the XRules document,
and that will provide another option. Another possibility (but I haven't
tried it) is creating an extended XPath function in your application to
replace the strings and adding it to the XRules Context object. This
should make the DynamicDOM call out to your custom function as needed.
You'll still use the <calculate> rule, but you'll be calling a custom
XPath function to do the string replacement. This, however, seems like
an overkill for what you need. Your method is a lot simpler.

Regards,
Waleed





-----Original Message-----
From: xrules@yahoogroups.com [mailto:xrules@yahoogroups.com] On Behalf
Of mike61079
Sent: Sunday, May 28, 2006 7:47 PM
To: xrules@yahoogroups.com
Subject: [xrules] a thank you and a question about string matching

Hello. I just wanted to say that this is a really great XML rules
library. I had already kind of made my own and then decided as
requests were getting more complicated to do research on what else
was out there. I came across this and it's perfect. It also seems to
work in .NET 2.0 very well which is great! I am surprised this is not
talked about more, it was kind of hard to find. Is there any
comparable W3C spec for doing this? What about comparable
applications? Who else makes something like this? It seems rather
unique as its focus is purely on XML. Which is perfect!

Also I had a usage question. I need to replace certain strings in a
node that match a list or otherwise leave them as they are. So I used
calculate to do that like this:

<xr:calculate target="value">
<xr:value when="value = 'A'">'Apple'</xr:value>
<xr:value when="value = 'B'">'Banana'</xr:value>
<xr:value>value</xr:value>
</xr:calculate>

Is this correct? Is there a better way?








Tue May 30, 2006 1:32 am

waleed_ka
Offline Offline
Send Email Send Email

Forward
Message #27 of 74 |
Expand Messages Author Sort by Date

Hello. I just wanted to say that this is a really great XML rules library. I had already kind of made my own and then decided as requests were getting more...
mike61079
Offline Send Email
May 29, 2006
10:45 pm

Mike, Thanks for your nice words. The business rules space is quite large and there are different tools and languages depending on what you need. You could...
Waleed K. Abdulla
waleed_ka
Offline Send Email
May 30, 2006
1:33 am

Mike, One thing to keep in mind when using the <calculate> rule is that the DynamicDOM will try to bring the values of the XML nodes to a stable state by...
Waleed K. Abdulla
waleed_ka
Offline Send Email
May 30, 2006
9:09 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help