[XML-SIG] 'searching' XML documents to extract 'chunks' of XML
Andrew M. Kuchling
Thu, 11 Mar 1999 11:06:26 -0500 (EST)
Tony McDonald writes:
>Dieter, do you have any sample code where the package is 'doing its stuff'?
>I've downloaded it and had a look around - I had always thought that XSL was
>a stylesheet translation language for XML, and where I've seen it mentioned,
>DSSSL and Jade (both of which blew my head off!) haven't been far
XSL seems to actually roll two ideas together. There's a
generic transformation language, which takes a document tree and a
specification for the transformation, and outputs the transformed
document. This could turn any XML document into an document for any
other XML DTD, so you could convert database entries into an HTMLish
or DocBook-ish form.
XSL also specifies a whole bunch of standard names for
formatting documents into a printed form, so an XSL processor could
take those and output matching TeX, PostScript, or whatever. However,
the transformation part of XSL is useful even if you're not formatting
for printing; the two ideas are separate and mushed together into one
specification. I think Paul Prescod suggested dividing the XSL work
into the transformation language and the formatting objects, and that
seems like an excellent idea.
>So I guess *now* I'm asking - how do you create a DOM given that you have a
>well-formed XML document to feed it...
There's a section on that in the HOWTO:
http://www.python.org/doc/howto/xml/node12.html . The easiest way
would be to read from a file:
from xml.dom import utils
reader = utils.FileReader('foo.xml')
reader.document is then the root of the DOM tree.
I don't know anything about how the XQL stuff works.
A.M. Kuchling http://starship.python.net/crew/amk/
"Since I'm so close to the pickle module, I just look at the pickles
directly, as I'm pretty good at reading pickles."
"As you all can imagine, this trick goes over really well at parties."
-- Jim Fulton and Paul Everitt on the Bobo list, 17 Jul 1998