JESS: Jess clp, JessML and Strings with embedded XML

"Nguyen, Son" <[email protected]>
Newsgroups gmane.comp.java.jess
Message-ID <10292_1285950371_o91GGGXT010727_433500A5BB71E0429667F320009F438B097849E2@resmsg04.AME.ad.sag>
Hi

I ran into an issue with String having embedded XML content.
Jess clp and JessML behave differently.

I have a clp function that prints out the String parameter.
I use the Jess XMLPrinter to transform the clp file into JessML.

They yield different results. In the clp case, the string is properly
handled, that is untouched.
Well, at least I think it is. In the JessML case, the string is
'interpreted' and the escaped XML becomes real XML.

Any feedback is greatly appreciated.

Son Nguyen


Here is the clp:

(deffunction aaa (?string) 
    (printout t "This is what I got" crlf ?string))

(defrule rule1 
	=>
	(aaa "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
	<xmlDoc version=\"1.0\">
		<value name=\"data\">

&lt;Values version=\"2.0\"&gt;
  &lt;value name=\"xml\"&gt;set in cell &lt;/value&gt;
&lt;/Values&gt;

    	</value>
    </xmlDoc>
"))

(reset)
(run)



The ouput for the clp run:

<?xml version="1.0" encoding="UTF-8"?>
	<xmlDoc version="1.0">
		<value name="data">

&lt;Values version="2.0"&gt;
  &lt;value name="xml"&gt;set in cell &lt;/value&gt;
&lt;/Values&gt;

    	</value>
    </xmlDoc

The output for the JessML run:

<?xml version="1.0" encoding="UTF-8"?>
        	<xmlDoc version="1.0">
        		<value name="data">
        
        <Values version="2.0">
          <value name="xml">set in cell </value>
        </Values>
        
            	</value>
            </xmlDoc>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.