AW: xmlerr, can't parse xml, Extra content at the end of the document

Tiemo Hollmann TB toolbook at kestner.de
Tue Mar 24 03:35:08 EDT 2015


Hi Kee,
yes, I once thought it would be easier to access the data, with creating
"named" nodes, but you are right, obviously that wasn't a good idea and I
will probably restructure my xml as you pointed it out.
Thank you for bringing me back on track again
Tiemo


-----Ursprüngliche Nachricht-----
Von: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] Im Auftrag
von kee nethery
Gesendet: Montag, 23. März 2015 22:30
An: How to use LiveCode
Betreff: Re: xmlerr, can't parse xml, Extra content at the end of the
document

Are you confusing data with labels?
kee


Normally you’d do something like this where the data is not part of the
labels (the indents are just for readability):

<?xml version="1.0" encoding="UTF-8”?>
<myLiveCodeXml>
	<user id=2>
		<username>Tiemo Hollmann</username>
		<email>toolbook at kestner.de</email>
	</user>
	<user id=6>
		<username>Kee Nethery</username>
		<email>kee at ieee.org</email>
	</user>
</myLiveCodeXml>




> On Mar 23, 2015, at 3:11 AM, Tiemo Hollmann TB <toolbook at kestner.de>
wrote:
> 
> Hello,
> 
> I am using since some time successfully XML files with LC 6.5.2. Now I 
> wanted to allow the user to enter spaces in their names like “Tiemo 
> Hollmann”, which I am using as tag names in my xml file. Because 
> spaces are not allowed characters in XML tag name I replace the spaces 
> by “$” before creating and saving the xml file and vice versa after
reading the xml file.
> When trying to read such a xml file I get the error: “xmlerr, can't 
> parse xml, Extra content at the end of the document” though “$” is a 
> valid character for tag names in the xml spec. I tried the same with 
> other chars like “§” or “%” with the same error. The xml file looks like
this:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <My$Name>
> 
> ...
> 
> </My$Name>
> 
> The LC line is: put revXMLCreateTreeFromFile(tXMLFile,true,true,true)  
> into tID
> 
> When deleting the “$” signs from the tag names, I can import the file 
> without error. I also tried it without encoding="UTF-8", but with the 
> same error. There is no trailing char after the last tag name.
> 
> Any idea what I am doing wrong?
> 
> Thanks
> 
> Tiemo
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list