I'm not sure if XmlPackageReader is maintained anymore. My question is, why
are you using xml format? Are you coming from a previous version of drools?
I think that, at least, since 5.1 XML format was deprecated. Rules must be
defined in DRL or some of its flavors: spreadsheets, templates, etc. If you
are coming from an old version of Drools, I would recommend you to convert
your XML rules to DRL using the old version of Drools and then try to adapt
them to 5.3 (it shouldn't be that hard).

Best Regards,

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Thu, Dec 15, 2011 at 9:55 AM, srinivasasanda <[email protected]>wrote:

> Hi Esteban,
>
>  I need to know whether we can* convert XML file to normal drl file* in
> Drools 5.3.0 Final Guvnor.If it is possible how??
>        PackageBuilderConfiguration conf = new
> PackageBuilderConfiguration();
>                XmlPackageReader reader = new
> XmlPackageReader(conf.getSemanticModules());
>                DrlDumper dumper = new DrlDumper();
>                FileReader filereader = new
> FileReader("test_ParseGlobal.xml");
>                PackageDescr descr = reader.read(filereader);
>                String test = dumper.dump(descr);
>                System.out.println(test);
>                FileWriter writer = new FileWriter(new
> File("test_ParseGlobal.drl"));
>                writer.write(dumper.dump(descr));
>                writer.flush();
>                writer.close();
>
> This is my code to convert it..Is it correct?..My XML file
> test_ParseGlobal.xml contains the rule content what is present in the above
> link.But the above code compilation fails and returning
> Exception in thread "main" java.lang.NullPointerException
>        at
>
> org.drools.xml.ExtensibleXmlParser.resolveSchema(ExtensibleXmlParser.java:696)
>        at
>
> org.drools.xml.ExtensibleXmlParser.resolveEntity(ExtensibleXmlParser.java:622)
>        at
> org.apache.xerces.util.EntityResolverWrapper.resolveEntity(Unknown
> Source)
>        at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown
> Source)
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/XML-Rule-Language-Please-help-tp3587815p3588015.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to