New Javascript parser and TinyXSL
13:48, 31 Jan 2001 UTC | Eric van der Vlist

Cyril Jandia has announced an ECMAScript Parser for "almost" XML, ESPX, and TinyXSL, an XSLT like "mini-language" for performing simple transformations. These programs provide limited XML/XSLT support to ECMAScript compliant parsers.

Even though the announcement was sent to the sml-dev mailing list, ESPX supports a subset of XML much larger than Minimal-XML, and includes attributes, mixed content, comments and CDATA sections. The main restriction compared to XML 1.0 is that document type definitions (internal or external) are ignored. Namespaces in XML 1.0 aren't supported either. The EPSX API is inspired by the DOM.

ESPX appears then to be an attempt to go as far as is practical to provide a robust parser written in Javascript, which could be used for XML applications on browsers lacking XML support.

TinyXSL extends the same idea to transformations, without trying to be an XSLT subset, and choosing a set of element names different from those of XSLT to avoid any confusion between the two languages.

TinyXSL doesn't rely on XPath expressions, but uses access to the underlying pseudo-DOM defined by ESPX, allowing instructions such as:

<txsl:when test="self.attributes[`@xml:lang`]==`fr-FR`">

A demonstration is available on Jandia's ESPX page.

Jandia acknowledges that there are performance issues:

...for documents above 36kb, you must be aware that the parsing/tree building durations currently experienced are simply not acceptable (more than 2 seconds).

He makes optimization the number one priority for further developments -- followed by namespaces support, a SAX-like version, and improvements to TinyXSL.

Related stories:

| See all 4 comments

Newest comments

Demo link dead (Mario - 21:52, 19 Oct 2003)
The demo link is dead.
Re: New Javascript parser and TinyXSL (th - 23:12, 16 Apr 2003)
Re: New Javascript parser and TinyXSL (Dan Brickley - 20:45, 1 Feb 2001)
So I'll leave it to Jan Grant to send round a proper announcement when its ready, but since it's so ...
Re: New Javascript parser and TinyXSL (Rodney Reid - 06:53, 1 Feb 2001)
I couldn't get the sample listed to work off the bat in Netscape 4.08 and IE 6.0 beta 2 on a pc, but ...
xmlhack: developer news from the XML community

Front page | Search | Find XML jobs

Related categories