commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lily <lil...@gmail.com>
Subject how to include an xmlrule file in another xmlrule file
Date Fri, 23 Sep 2005 20:22:02 GMT
Hello,

I am using the <include path=""/> to import a xmlrule file into another rule
file, but it always give me a

org.apache.commons.digester .xmlrules.XmlLoadException: Error at (6, 37:
File "rules2.xml" not found.
java.lang.NullPointerException

I have tried to use the full path to rules2.xml or relative path, but none
of them worked.

Could you please tell me how to compose the uri for path to work (load in
the content in rule2.xml)?

Suppose: I have rules1.xml at location : /data/test/digester/rules1.xml
rules2.xml at location: /data/test/digester/subrule/rules2.xml
And my java class which construct the digester is in
package com.a.b.c;

public class DigestTest {

private static Digester getDigester() {
File in = new File("/data/test/digester/rules1.xml "); // the parent rule
file
try {
return DigesterLoader.createDigester(in.toURL());
} catch (Exception e)
{
System.out.println(e);
return null;
}
}

public static Foo parseMsData(String inputXml)
throws SAXException, IOException {
DigesterRuleParser parser = new DigesterRuleParser();
return (Foo) getDigester().parse(new StringReader(inputXml));
}
}

Thanks a lot!

Lily

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message