Giter Site home page Giter Site logo

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024

Original comment by [email protected] on 24 Jun 2008 at 1:01

from codeswarm.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
[deleted comment]

from codeswarm.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.