Re: XML support in E

Thomas Leonard <[email protected]>
Newsgroups gmane.comp.lang.e.general
Message-ID <[email protected]>
2010/1/14 Kevin Reid <[email protected]>:
> 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.

Over the next few months we'll be connecting it up to systems that use
XML, but if there's no native E support then we'll just import and use
the normal Java DOM libraries.

>> My main concern here is about speed. [...]

> 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.

OK, I can create JSON documents easily enough using

def Term := <type:org.quasiliteral.term.Term>
def serialised := (testData :Term).asText()

This is nice and fast, and I assume it could produce XML in a similar way.

I can turn the serialised string back into a term like this:

def TermParserMaker := <import:org.quasiliteral.term.makeTermParser>
TermParserMaker(serialised)

But how do I turn that term back into the E data-structure (i.e.
reverse the effect of :Term)?


-- 
Dr Thomas Leonard		ROX desktop / Zero Install
GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.