Okay everyone.  Go sync down the drools-2 CVS module.

./build.pl clean all test

Watch some rules get applied to XML documents.

There's org.drools.RoughDom4jTest which looks for two documents:

doc #1
        <a id="$ID$">
                ...
        </a>

doc #2

        <b id="$ID$">
                ...
        </b>

One must have a root element of <a>, another must have a root element
of <b>, and the root elements must have an @id attribute that is the same.

Yes, it actually works.

Roughly, the rule is:

        parameters:
                Document(<a>) doc1
                Document(<b>) doc2

        local decls:
                String id;

        conditions:
                id = doc1 -> string(/a/@id)
                id = doc2 -> string(/b/@id)

        action:
                print HI MOM

The XPathFactExtractor can certainly be made more robust,
by letting the Tuple act as a VariableContext, allowing
wacky XPath-based filters:

        $item/quantity > $request/quantity

Should be relatively painless, I think.  Just need to have
a Jaxen Visitor to pull out variable references, maybe.

Anyhow, James, especially you, when you get a moment, check
it out.  

        -bob


_______________________________________________
drools-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/drools-interest

Reply via email to