Lists Home |
Date Index |
- To: email@example.com
- Subject: XML Hangover
- From: Joe Schaffner <firstname.lastname@example.org>
- Date: Mon, 11 Jul 2005 21:42:38 +0300
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=lDI6OkCJPdGwx759R45cvh/VaaaG0k6f5CdnaYjY4gvrLqNEOqIue+1Oqzpeekyz8/mXhIX4PiWxnnO/WM7oHEXnOXLMQTVUX+iNayNmG+fM3Q+IPS3N0FCl/L0hRSUtjmY0hzrAaItj8FP6xmo5MhkI37xMUs5Bz80UkuFIAXc=
- Reply-to: Joe Schaffner <email@example.com>
I've been reading the XML litterature. It's great. Just a few comments:
XSL - XML Stylesheets is divided into two parts, XSL-T and XSL-FO.
The T part deals with templates and translation. Since HTML is valid XML, I guess I can parse my HTML using XSL-T to produce XML and vice versa. I don't understand why XSL-T refers to "nodes in an output tree". This suggests some kind of internal representation, but XML is perfectly good representation language. Don't <templates> merely write XML text to stdout?
Roughly, the process seems to work like this: the T processor does a recursive descent of the source XML. At each node it evaluates the set of templates. Those templates which match the name of the "current" tag are processed, in some order. The template writes text, that's why it's called a "template. The recursive descent is continued with an <apply-templates> tag inside the template. This allows you to balance output.
If no matches are found, the T processor continues the descent.
There is a <template> tag (I forget what) which will select arbitrary paths in the souce tree, and there are tags which iterate through the result. This will allow me to build up a result "tree" which is not a mirror image of the source, something I need to do if I'm rearranging sections of the input document. Rather than buffering intermediate structures, the T processor does multiple passes based on these tags, and creates the output on-the-fly. Cool.
Then there is the DOM - Document Object Model... but my XML already defines the document's object model. It's whatever I decide it to be. Why the confusion? Are you referring to parsing an XML document using some kind of programming environment to produce a tree in some kind of intermediate representation? Are there C libs/structs or Java classes or Perl modules which tear apart an XML document?
This would allow someone to build an XML parser into any configuration program.
The FO of XSL parts looks alot like Knuth's TeX, a graphical document description language, set in XML, incredibly complex. I guess there are FO display tools out there (called "formatters") that interpret FO. [Postscript was a procedural language for graphical page description. PDF is a data definition language which takes the procedures out of Postscript. FO is a data definiton language which describes the appearance of an XML document as richly as these other languages.]
[Does anybody remember what a dvi representation did? I think it stood for "device indepent" but TeX was already device independent.]
I had a ghostscript viewer which seemed to understand dvi files, and postscript too. It was quite clumsy.
I assume there is nothing stopping me from using XSL-T to transform my HTML to PDF, but it seems best to output XSL-FO then create a PDF using some kind of tool. What is that tool?
Are there FO plug-ins available for my browsers?
Does this technology work?