[rules-users] XmlDumper use
Edson Tirelli
tirelli at post.com
Mon Jan 28 13:16:04 EST 2008
You need to go down one level and use the DrlParser instead of the
PackageBuilder:
final DrlParser parser = new DrlParser();
final PackageDescr pkg = parser.parse( reader );
[]s
Edson
2008/1/27, Mark McNally <mark.mcnally at comcast.net>:
>
> I would like to use the XmlDumper to convert my DRL to XML but am unsure
> of its use.
> In particular, I am wondering where to get the proper instance of
> PackageDescr to feed to the dump() method:
>
> XmlDumper xmlDumper = new XmlDumper();
> String xml = xmlDumper.dump( packageDescr );
>
>
> the code I'm using to read the DRL is straight from an example in the
> distro:
>
> Reader source = new InputStreamReader(
> PartSelectorImpl.class.getResourceAsStream( ruleSetName ) );
> PackageBuilder builder = new PackageBuilder();
> builder.addPackageFromDrl( source );
> Package pkg = builder.getPackage();
> RuleBase ruleBase = RuleBaseFactory.newRuleBase();
> ruleBase.addPackage( pkg );
>
>
> Would someone mind pointing in the right direction?
>
> Thanks, Mark
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080128/eddb3798/attachment.html
More information about the rules-users
mailing list