Thank you Edson.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli
Sent: Monday, January 28, 2008 12:16 PM
To: Rules Users List
Subject: Re: [rules-users] XmlDumper use



    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 <[EMAIL PROTECTED]>: 

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
[email protected]
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 

_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to