XML library reliable?
Mark Brownell
gizmotron at earthlink.net
Tue Jul 22 09:24:00 EDT 2003
On Monday, July 21, 2003, at 10:35 PM, Joël Guillod wrote:
> 1) Consider that you:
>
> set the htmltext of field 1 to that -- : ...
>
> <p>©2003 by Joël Guillod</p>
> <p><font color="#0000FF"><u>joel.guillod at net2000.ch</u></font></p>
> <p></p>
>
>
> 2) execute this test script:
>
> on test
> put "<fld1>" & (the HTMLtext of fld 1) & "</fld1>" into xmldata
> put revCreateXMLTree(xmldata,false,true,false) into fldTreeID
[snip]
> 3) Why dont I get the same than the original data: i.e. why xmldata is
> not
> xmlDataRestored? The procedure looses the diacritics (the euml for ë
> and
> nothing for the copyright character). I actually get:
>
> <fld1><p>2003 by Jol Guillod
> joel.guillod at net2000.ch
> </p></fld1>
Warning, untested thinking,
I haven't tested for this but off hand I would say by your results that
the XML parser is handling the text according to the rules of SGML
correctly. Line-returns, in combination with the HTML "<p> </p>," are
not being restored because they are not allowed in XML. Like empty
space that is reserved for the creation of attributes in SGML, you
might need to place all your text data on a single line. This might
then result in a returned chunk of HTML text that will render correctly.
Example:
<p>©2003 by Joël Guillod</p><p><font
color="#0000FF"><u>joel.guillod at net2000.ch</u></font></p><p></p>
You might further test XML by placing all your HTML text in one line &
into an attribute in combination with including the escape-sequences
for the quote characters.
Example:
<htmlChunk text="<p>©2003 by Joël Guillod</p><p><font color=
"e;#0000FF"e;><u>joel.guillod at net2000.ch</u></font></p><p></
p>"></htmlChunk>
Mark Brownell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1879 bytes
Desc: not available
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20030722/815ca780/attachment.bin>
More information about the use-livecode
mailing list