CDATA and xml.compile bug

Emmanuel. M. Decarie emm at scriptdigital.com
Mon Nov 19 12:20:02 PST 2001


Mac OS X 10.1.1/ Frontier 7.1b20

Hello,

I have a hard time to understand the logic but it seems that  CDATA 
sections  will not appears in certains circonstances and will appears 
in others.

For example put in a wp text object at workspace.cdata this xml text:

<?xml version="1.0"?>
<root>
<![CDATA[<http://nowhere.com> & <http://somewhere.com>]]>
</root>

Then run this script:

local (s = string(workspace.cdata));
xml.compile (s, @workspace.cdatacomp)

xml.compile will not create a /cdata table (see the doc below).

Now put this at workspace.cdata and run again the script.

<?xml version="1.0"?>
<root content="urls">
<![CDATA[<http://nowhere.com> & <http://somewhere.com>]]>
</root>

Now a /cdata table is created.

Now, put at workspace.cdata this xml text and run the script.

<?xml version="1.0"?>
<root>
<![CDATA[<http://nowhere.com> & <http://somewhere.com>]]>
<othertag>hello</othertag>
</root>

Again, a /cdata table is created.

Thanks to Stéphane Volet who helped to find this bug (and who tested 
it on Win with 7.0.1)

>CDATA sections are fully supported. When encountered, xml.compile 
>creates string objects named /cdata. xml.decompile creates the 
>appropriate CDATA section markup for such items. In both cases, the 
>text replacements discussed above are not performed.
<http://frontier.userland.com/stories/storyReader$1057>

Cheers
-Emmanuel
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Emmanuel Décarie - Consultant
   Programmation pour le Web - Programming for the Web
   UserLand Frontier  - Perl - JavaScript - AppleScript - HTML - XML
   http://www.scriptdigital.com 

---> The Frontier Newbie Toolbox:
   <http://www.scriptdigital.com/fnt/frontierNewbieToolbox.html>




More information about the Frontier-Users mailing list