anilmuthineni / foxreplace

Automatically exported from code.google.com/p/foxreplace
0 stars 0 forks source link

Receiving Error while processing XML: SyntaxError: unexpected end of XML entity while importing and XML file #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load a big XML file, 246 kBytes / 4662 lines, XML tags are balanced, some 
substitution tags are large. Largest is 492 bytes

What is the expected output? What do you see instead?
- Cannot import XML file with substitution tags

What version of the product are you using? On what operating system?
- FoxReplace 0.12.2 / Firefox 8.0 / Windows 7

Please provide any additional information below.
- I've already used the import, but a shorter file, approx. 3000 lines. I'll 
try if the problem are the largest substitution tags.
- Are there any restriction about a substitution length? 

thanks
Gustavo

Original issue reported on code.google.com by glourenc...@gmail.com on 3 Dec 2011 at 2:03

GoogleCodeExporter commented 9 years ago
Update 1:
Tested alone, there is no problem with the length of one substitution, I've 
tested the largest alone and worked.
Also there is no problem with the length of the entire file, because I decrease 
it trimming some substitions and also doesn't work.
I guess, may be a special char could be the problem, I'll try to find any 
regular expression within the text.
thanks

Original comment by glourenc...@gmail.com on 3 Dec 2011 at 3:06

GoogleCodeExporter commented 9 years ago
all set, there was an "&" inside the input text, spliting input in 2 lines 
without the "&" was all set.
there would be nice to explain that '&' character may cause trouble.
ready to close
thanks
Ggustavo

Original comment by glourenc...@gmail.com on 3 Dec 2011 at 5:04

GoogleCodeExporter commented 9 years ago
finally, in the help, the link to "regular expresions" explanation in mozilla 
help doesn't show the right explanation

Original comment by glourenc...@gmail.com on 3 Dec 2011 at 5:07

GoogleCodeExporter commented 9 years ago
Hi, nice to see you could resolve the problem for yourself ;)

The issue with the ampersand is not in the regular expressions of JavaScript, 
but in the XML format itself. '&' marks the start of an entity, as wells as ';' 
marks the end. So, to use represent '&' you have to put '&' in the XML file. 
For other predefined entities you can refer to 
https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#P
redefined_entities_in_XML

Original comment by marc.r...@gmail.com on 4 Dec 2011 at 1:29

GoogleCodeExporter commented 9 years ago
Hey, it's sunday! many thanks for your clear explanation. FoxReplace it's 
really incredible.
I'll tell my experience for your records. Now, working with an XML file which 
has near 5000 reusable translatedc phrases and 950 kbytes. With this large file 
"whole words" is faster than "text". Using "text" literally dies, with "whole 
words" take about 5 to 10 seconds (using a quad core with 4gb ram and over 
windows 7 64 bits with nightly firefox 11.0, this is a bit faster than firefox 
8). Try to discover if something may things faster, only one cpu core is 
allocated during F2.
regards
Gustavo

Original comment by glourenc...@gmail.com on 4 Dec 2011 at 2:40

GoogleCodeExporter commented 9 years ago
I didn't know that "whole words" is faster than "text" (at least in your case), 
and now I don't know why. It could be that RegExp search is faster than plain 
string search, as "whole words" uses a RegExp and "text" doesn't, but I'll have 
to try.

Also, all the code is single-threaded, so it can only use one core, but I'll 
investigate if it can be multi-threaded.

I take note of both ideas. Thanks!

Original comment by marc.r...@gmail.com on 4 Dec 2011 at 7:01