A simple XSLT would be sufficient to split an XML according to element
categories, i.e., defrule, deftemplate, etc.
Then, these could be converted individually into clp.
-W

On Wed, Apr 1, 2009 at 9:45 AM, Joao Antunes Mourao <
[email protected]> wrote:

> Thanks Wolfgang, it worked. The only thing is that the xml code is not
> related to an clp file, but instead you have a single xml file, containing
> all the information in several clp's. This might be a problem if you want to
> change a rule in xml file, and then convert into the clp's. I mean the pair
> relation xml/clp is lost.
>
> Anyway, for now it work fine. Thanks again.
>
> Joao
>
> On 30-03-2009 17:57, Wolfgang Laun wrote:
>
>> Well, you won't be able to print each .clp as an individual .xml. So, pass
>> in all .clp files and iterate.
>>
>> See below for modified code.
>>
>> I've never tried this, but I guess that's the only chance you have, short
>> of merging the clp files.
>>
>> On Mon, Mar 30, 2009 at 5:39 PM, Joao Antunes Mourao <
>> [email protected] <mailto:[email protected]>>
>> wrote:
>>
>>    Thanks Wolfgang, but i don-t understand.
>>    do you mean use the function to translate all the files, between
>>    the front/backMatter calls? But for me to create a printer i need
>>    to pass the FileReader i want to print. I'm using the following
>>    function to print the files. Could you explain me your idea,
>>    exemplifying with this code?
>>
>>
>>
>> MODIFIED:
>>
>>
>>    public void printAFile(String[] jessfile) throws IOException,
>>    JessException{
>>
>>          String xmlFile= "all.xml";
>>          FileWriter fw=new FileWriter(xmlFile);
>>          XMLPrinter printer = new XMLPrinter(new PrintWriter(fw, true));
>>          try {
>>              printer.printFrontMatter();
>>
>>             for( String jf: jessfile ){
>>                  FileReader fr = new FileReader(jf);
>>                  printer.translateToXML(fr);
>>              }
>>
>>              printer.printBackMatter();
>>          } finally {
>>              printer.close();
>>          }
>>      }
>>
>>
>> END MODIFIED
>>
>>
>>    Regards,
>>
>>    Joao
>>
>>
>>
>>    Thanks again,
>>
>>    Joao
>>
>>
>>    On 30-03-2009 16:57, Wolfgang Laun wrote:
>>
>>        Try to use the methods of jess.xml.XmlPrinter, calling
>>        translateToXml for each of your .clp files,
>>        in a sequence honouring the dependencies, and this suitably
>>        enclosed in front/backMatter calls.
>>
>>        XmlPrinter "dumps" what is in the Engine; so you cannot
>>        translate incomplete XML.
>>
>>        -W
>>
>>
>>        On Mon, Mar 30, 2009 at 3:34 PM, Joao Antunes Mourao
>>        <[email protected]
>>        <mailto:[email protected]>
>>        <mailto:[email protected]
>>        <mailto:[email protected]>>> wrote:
>>
>>           Hello,
>>
>>           I'm trying to pass my rules files written in jess syntax
>>        into XML.
>>           I heard about the JessML tool to convert these. However,
>>        i'm find
>>           some problems with this.
>>
>>           I have a number of rules files, .clp, which are connected
>>        through
>>           the procedure require/provide. When i try to use the JessML, it
>>           gives me errors, saying that for some template the slot is not
>>           defined. The reason for that is that the template is defined in
>>           some other file. But again, JessML should know about this
>>           template, since there is a require statement before, in
>>        where the
>>           templates are defined.
>>
>>           Does the JessML handles the require/provide statement?
>>
>>           Regards,
>>
>>           Joao
>>
>>           --------------------
>>           unclassified email
>>
>>
>>
>> ------------------------------------------------------------------------------------------------------------
>>           Disclaimer:
>>
>>           If you are not the intended recipient of this email, please
>>        notify
>>           the sender and delete it. Any unauthorized copying,
>>        disclosure or
>>           distribution of this email or its attachment(s) is forbidden.
>>           Thales Nederland BV will not accept liability for any damage
>>           caused by this email or its attachment(s). Thales Nederland
>>        BV is
>>           seated in Hengelo and is registered at the Chamber of Commerce
>>           under number 06061578.
>>
>> ------------------------------------------------------------------------------------------------------------
>>
>>
>>
>>
>>
>>  
>> ------------------------------------------------------------------------------------------------------------
>>    Disclaimer:
>>
>>    If you are not the intended recipient of this email, please notify
>>    the sender and delete it. Any unauthorized copying, disclosure or
>>    distribution of this email or its attachment(s) is forbidden.
>>    Thales Nederland BV will not accept liability for any damage
>>    caused by this email or its attachment(s). Thales Nederland BV is
>>    seated in Hengelo and is registered at the Chamber of Commerce
>>    under number 06061578.
>>
>>  
>> ------------------------------------------------------------------------------------------------------------
>>
>>
>>
>
>
> ------------------------------------------------------------------------------------------------------------
> Disclaimer:
>
> If you are not the intended recipient of this email, please notify the
> sender and delete it. Any unauthorized copying, disclosure or distribution
> of this email or its attachment(s) is forbidden. Thales Nederland BV will
> not accept liability for any damage caused by this email or its
> attachment(s). Thales Nederland BV is seated in Hengelo and is registered at
> the Chamber of Commerce under number 06061578.
>
> ------------------------------------------------------------------------------------------------------------
>
>

Reply via email to