From: Nat Pryce Date: 2001-11-15T21:26:56+09:00 Subject: [ruby-talk:25256] Re: XML support in the standard lib;whatexactly? From: "Tobias Reif" > Nat Pryce wrote: > > [...] > avoid the DOM API and instead provide a standard Ruby XML API > that is more convenient for querying, modifying and transforming XML > documents. > [...] > > I agree. Only two questions: > > > Factor in the fact that the DOM API does not > > support XPath queries, > > Doesn't it? > http://www.w3.org/TR/DOM-Level-3-XPath/ That's a working draft. It is not a finished reccomendation (W3C-speak for standard). > > or XSLT transformation rules, > > > How would that look, in pseudo code? > IMHO, XPath is nice to have in a tree API; but XSLT is a whole different > story. I like it to be separate and pure. XSLT files still can be used > from the same program that manipulates a tree. > > Perhaps extraxt specific templates from the file, and call them with an > input tree from the tree parser? Interesting... XSLT engines, such as that implemented by Microsoft's XML library, parse an XSLT file into a transformer object that contains an optimised representation of the templates. The program can then use the transformer to transform many XML document trees without having to reparse the templates, > > In an XSLT transformation engine, > > that's a table-driven rule interpreter. Etc. etc. > > what does 'table-driven' mean here? Although an XSLT template is an XML document, and could be represented as a document tree, XSLT implementations actually parse each template into an optimised form that caches information in tables to make template matching as fast as possible. Cheers, Nat.