do you have samples of the working and broken xml files?

perhaps if you showed them, we would have a better idea ...

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.

-jason
On Apr 5, 2006, at 11:27 AM, Marc Zeedar wrote:


Hi gang!

I'm getting into XML and I've run into a puzzle. My app saves and loads
XML files, but suddenly I'm getting a few beta testers with files that
won't open. These files were created by my app. I get an XMLException
right at the "loadXML" parse command with an error of "XML parser error 3:
not well-formed (invalid token)."

What I can't figure out is where the error is lcoated. The line number
shows an innocuous line in the XML and when I delete that "bad" XML node it just gives me an error at a different line. If I delete enough stuff
eventually the file will open, but there doesn't seem to be a rhyme or
reason to it.

Since the XML in question is generated by my app, the actual formation of the tags is standard; since some files work and some don't, it can't be in how I'm nesting the tags. The only thing I can think of is that there's something in the user's *content* (data being saved) that's causing the
error, but the data appears to be pretty simple text.

Any ideas how to debug this? I'm a bit at a loss since it just errors when I pass the XML to the parser, with no way of figuring out what, exactly,
is causing the problem.

Oh, and I'm using RB5.5.5 -- I haven't yet converted my app to RB2005/6 yet. Don't know if that makes a difference, but if it's a bug in RB's XML
parser I suppose it might be fixed in a more recent release.


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

Reply via email to