Comments (7)
The XML spec says:
'"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
So it appears the ", < and & needs to be escaped.
Original comment by [email protected]
on 24 Jun 2008 at 7:55
from codeswarm.
Original comment by [email protected]
on 24 Jun 2008 at 1:01
from codeswarm.
for escaping i have added :
import xml.sax.saxutils
and in the create_event_xml:
called xml.sax.saxutils.escape(event.filename) and for event.author to
Original comment by [email protected]
on 6 Jul 2008 at 11:29
from codeswarm.
[deleted comment]
from codeswarm.
I tried several approaches to fixing the issue since I got hit by it (the svn
log I'm
trying to convert contains "&", ">" and "<" characters in file names):
* Using xml.dom.minidom to generate the output XML instead of manual borking
* Using ElementTree to generate the whole document
* Using ElementTree to generate each <event/> element (but leave the outermost
part
of the document written manually)
* implement suggestion of #3
the results were the following, given a baseline performance of 9.5s to
generate the
file with the current incorrect script (the input verbose svn log is 29Mb, the
output
file contains nearly 270k events):
* Minidom generation takes about 3mn, which is clearly unacceptable. On the
other
hand, it can be cleanly formatted (whitespace and indentation, ...)
* Generating the whole document with ElementTree (or cElementTree) took 40s (or
30s),
which is 4 (or 3) times that of the current incorrect solution but looks much
cleaner. I also don't believe this is too problematic a time as conversion
shouldn't
be done often. On the other hand, it requires bundling ElementTree.
* Generating the document lines with ElementTree (or cElementTree) actually had
performances worse than the case above by 10%, at 44s (or 33), but it requires
a much
lower amount of memory.
* Finally, simply adding escaping via saxutils was a bit above 11s.
I'm attaching the patch (which should apply cleanly at p1) for the later
version, but
I can also provide a patch for elementtree-generation if desired.
Versions:
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
ElementTree and cElementTree are those built in Python 2.5, so is saxutils
Original comment by [email protected]
on 14 Jul 2008 at 10:46
Attachments:
from codeswarm.
Just wanted to confirm that this patch appears to work. I was getting EOF
exceptions
at run time from Java and after applying this to convert_logs.py it worked.
Original comment by [email protected]
on 14 Jul 2008 at 5:09
from codeswarm.
I have applied the patch to the trunk, thanks :)
Original comment by [email protected]
on 15 Jul 2008 at 12:40
- Changed state: Fixed
from codeswarm.
Related Issues (20)
- Refactor the code_swarm class to be more readable and maintainable
- run.sh does not work from /usr/local/bin or equivalent HOT 1
- significant dot-size variation when ran on desktop vs laptop (subpuxel rendering?)
- window expose events can cause code_swarm to hang sometimes
- Older CVS version uses different date format (convert_logs.py)
- Mercurial support HOT 4
- Subversion log entrys are not differentied for conversion.
- Processing Code HOT 1
- Hangs on Chaotic engine
- Histogram configuration and documentation HOT 1
- convert_logs.py - fails to convery SVN logs that contain square braces in the comments
- Allow commiter names to be translated
- Convert TFS Log
- Doesn't work for huge activity logs HOT 2
- Mercurial Log Generation - requirement 'dotencode' not supported! HOT 1
- hg_log.py doesn't work with OSX Lion HOT 3
- 3D support
- [Fatal Error] activity.xml:22858:78: Element type "event" must be followed by either attribute specifications, ">" or "/>". HOT 1
- Patch to allow svn xml log parsing
- Gravatars overlayed on non-blank backgrounds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeswarm.