On Wed, April 5, 2006 5:35 pm, Jason Essington wrote:
> do you have samples of the working and broken xml files?

Unfortunately the only examples I have now are files users have sent me,
and they contain personal data and are not available to the public.
However, that's a good idea; I'll see if I can get permission.

Meanwhile, here's a small excerpt that contains no personal info:


<Section name="----------13  APR  2010  -  NO  WORD  TODAY"
cursorStart="0" cursorEnd="120" cursorScroll="0"
contentType="text"><stylerun bold="F" italic="F" underline="F" size="18"
red="0" green="0" blue="0" font="Lucida
Grande"/>xx&amp;#013;&amp;#013;xxxday,  13  APR  2010&amp;#013;&amp;#013;A
Word A Day&amp;#013;- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - &amp;#013;&amp;#013;No word today&amp;#013;&amp;#013;xx &amp;#013;
</Section>

This is two lines of XML. The parser claims the error is in the last line,
the "</Section>" line.

The &amp;#013; are encoded carriage returns. I encode them as &#013; but
RB's XML engine further encodes the ampersand as &amp; not that it seems
to cause any problems. I had to encode the returns because XML didn't
handle actual returns within textnodes properly in all cases.

I will stress that this structure works great for all my test files; it
wasn't until the public beta was widespread that a couple users reported
files that won't open. It's very odd.


> but if you are allowing user generated text into the xml, then you
> may have better luck with CreateCDataSection rather than
> createTextNode. Users are certain to break your app in ways that you
> never thought of, and CDATA is a bit safer than a plain textNode.

That's an interesting idea. However, CDATA seems to only be available with
RB 2005+, not in RB5.5 (at least it's not in RB5.5's LR).


-- 
Marc Zeedar
Publisher
REALbasic Developer Magazine
http://www.rbdeveloper.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to