[rules-users] Solution for reasoning over XML?

Wolfgang Laun wolfgang.laun at gmail.com
Fri Jan 11 06:56:48 EST 2013


On 11/01/2013, FrankVhh <frank.vanhoenshoven at agserv.eu> wrote:
> With Wolfgang's approach, your patterns looking like:
>
> XmlElement(name="SomeClass",value="foo",attribute["myAttr"] == bar)
>
> Would turn into:
>
> SomeClass(value == "foo", myAttr == "bar")

Not quite. A DOM tree would be represented by a very small object
hierarchy according to the XML node typology:
node-element-attribute-text, etc. What I proposed in my IntelliFest
2012 paper is the addition of facts representing the DOM *structure*
to Pojos unmarshalled from the DOM tree.

>
> Without having any numbers, we can still safely say that the performance
> improvement that you should get from using the pojo's, especially with
> "big"
> files, should be somewhere in between "quite considerable" and "huge".

It may reduce the number of facts by an order of magnitude, depends on
the XML tree's fan out, with consequences for insert, etc. There may
also be a penalty due to remaining at the level of "all is String"
(depends on the data).

-W

>
> Out of curiosity:
>  A) Do you also call Modify or Update in your THEN clause?
>  B) What does this DSL phrase resolve to?
>
> An XML element exists
> - named someName with a value of
> - at path /some/xpathlike/path with a value in "someVal","someOtherVal"
>
> Regards,
> Frank
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Solution-for-reasoning-over-XML-tp4021454p4021462.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list