OK, so ignore my previous comment.
You say that it doesn't handle returns *in all cases*? What does this
mean exactly - when does it and when doesn't it?
Nick
On 5 Apr 2006, at 18:45, Marc Zeedar wrote:
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&#013;&#013;xxxday, 13 APR
2010&#013;&#013;A
Word A Day&#013;- - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - - &#013;&#013;No word today&#013;&#013;xx
&#013;
</Section>
This is two lines of XML. The parser claims the error is in the
last line,
the "</Section>" line.
The &#013; are encoded carriage returns. I encode them as

 but
RB's XML engine further encodes the ampersand as & 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>
_______________________________________________
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>