[e-lang] XML support in E

Kevin Reid kpreid at mac.com
Thu Jan 14 04:40:50 PST 2010


On Jan 14, 2010, at 5:45, Thomas Leonard wrote:
> On Tue, 2010-01-12 at 17:06 -0500, Kevin Reid wrote:
>>   * Would you be interested in working on the project of an XML  
>> library
>>     for E?
>>
>>   * If I were to work on it, would you use it and give feedback?
>
> We'd certainly be interested in testing any XML support. I don't think
> I'd be able to help with the implementation though: a selling point  
> for
> E was compatibility with existing Java libraries, so telling my  
> manager
> I need to spend time implementing XML support is unlikely to fly ;-)

I'll look into it. Er, how soon do you need it? I'm rather busy, but I  
do *want* an E project; I just need to know how to prioritize this.

> My main concern here is about speed. I temporarily used the JSON  
> support
> in part of my code, and it noticeably slows the GUI down when used,  
> even
> for quite small documents! Here's a little test case, timing how  
> long it
> takes to serialise an example document:
>
> # Example document taken from http://jsonml.org/
> def testData := ["table", ["class" => "MyTable", "style" =>  
> "background-color:yellow"], ["tr", ["td", ["class" => "MyTD",  
> "style" => "border:1px solid black"], "#550758"], ["td", ["class" =>  
> "MyTD", "style" => "background-color:red"], "Example text here"]],  
> ["tr", ["td", ["class" => "MyTD", "style" => "border:1px solid  
> black"], "#993101"], ["td", ["class" => "MyTD", "style" =>  
> "background-color:green"], "127624015"]], ["tr", ["td", ["class" =>  
> "MyTD", "style" => "border:1px solid black"], "#E33D87"], ["td",  
> ["class" => "MyTD", "style" => "background-color:blue"], "\u00a0",  
> ["span", ["style" => "background-color:maroon"], "\u00a9"],  
> "\u00a0"]]]
>
> def jsonSurgeon := <elib:serial.deJSONKit>.makeSurgeon()

Oh, deJSONKit I wouldn't recommend for current practical purposes: the  
Data-E subsystem is relatively slow no matter what kit you use. (I  
don't know how much of this is simply due to inefficient E  
interpretation, vs. what serialization must do, or anything else.) Use  
the JSON subset of term-trees instead. Just wrap your JSON literals in  
term`...`, to start with.

-- 
Kevin Reid                                  <http://switchb.org/kpreid/>






More information about the e-lang mailing list