[TxMt] slow loading of large html/xml documents

Chris Adams chris at improbable.org
Tue Oct 2 23:46:11 UTC 2007


On Oct 2, 2007, at 12:39 PM, Raj Singh wrote:
> I've been seeing the same problem I think is described here:
> http://lists.macromates.com/pipermail/textmate/2007-July/020708.html
>
> I definitely see it with XML files all on one line (this is very
> common in my business as much of the XML I see is machine-generated).
> But I think I'm also seeing this with large multi-line files. For your
> testing pleasure, download the XML from this URL:
> http://giswebservices.massgis.state.ma.us/geoserver/wms? 
> request=GetCapabilities

I just ran into this yesterday with a large MySQL dump. In your case  
you can work around the problem by running XML through "xmllint -- 
format" to add new-lines in a safe manner:

chris at enceladus:~/Desktop $ cat temp.xml
<foo><bar><baaz/></bar></foo>
chris at enceladus:~/Desktop $ xmllint --format temp.xml
<?xml version="1.0"?>
<foo>
   <bar>
     <baaz/>
   </bar>
</foo>

In my case, I used Perl to add newlines for parentheses but that  
would be dangerous depending on the input data since it doesn't  
escaped string values at all (this wasn't an issue with my data).

Not handling really long lines is a common problem - vim also hung on  
my file.

Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2423 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20071002/25ee29f1/attachment.p7s>


More information about the textmate mailing list