Hi everyone,
New to the mailing-list, and new to Jess and Java. I'm currently creating a
web servlet that uses a Jess plug-in. I'm at the point where I have the Jess
facts, but would like to change the facts into XML and then output it to
PrintStream.
I've been trying for quite a while to figure this out (of course it's really
difficult because there's so little resources out there), but am pretty much
stuck. I have the only book about Jess (Jess in Action), but the answer wasn't
in there (as far as I can tell, the book talks about using XSLT, and more about
reading XML into Jess, not outputing in XML). So, I thought I'd ask the expert
and fellow mailing-listers instead.
I'm trying to use the Class XMLPrinter listed on the website. This is a
snippet of the code so far, but basically, I can't get it to work.
Particularly, the translateToXML method. Please, help. Thanks so much in
advance. If anyone could point me to some code example that has gotten the
translateToXML method and XMLPrinter class to work, that would be tremendously
helpful.
~~Terry
----------------------------------------------------------------------
try {
ret = rulePlugin.evaluate("(facts)");
for(Iterator<Fact> i = rulePlugin.getFacts();
i.hasNext(); ) {
Fact f = i.next();
String facts = f.toString();
try {
FileReader reader = new FileReader (facts);
reader.translateToXML();
}
finally {
out.println(f.toString());
}
}
}
catch(Exception e) { e.printStackTrace(); }
}
/****/
------------------------------------------------------------
Hsin Yi (Terry) Shen, MSPH
NLM Predoctoral Fellow
Department of Medical Education and Biomedical Informatics
University of Washington
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------