Re: JESS: Jess clp, JessML and Strings with embedded XML

"Ernest Friedman-Hill" <[email protected]>
Newsgroups gmane.comp.java.jess
Message-ID <[email protected]>
Looks like XMLPrinter isn't (properly) escaping your embedded XML.  
Thanks for the report.

On Oct 1, 2010, at 12:10 PM, Nguyen, Son wrote:

>
> 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>
>
>
>

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com







--------------------------------------------------------------------
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].
--------------------------------------------------------------------
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.