← Prev in month ← Prev in thread

XML + Javascript? was:[Whatever happened too CSS+XML]

From
Doug du Boulay <>
Date
2006-01-14T07:52:10+00:00
ID
Thread
XML + Javascript? was:[Whatever happened too CSS+XML]
I was just rereading the CSS+XML thread from back in November and it seemed 
that some folk were advocating using javascript to massage a DocBook document
to, say build a table of contents or an index on the fly, insert them into the 
DOM and then render them with CSS.

I was thinking about this when I realised that I don't know how to embed or 
execute javascript from within XML.

I know that for some browsers you can apply CSS using a leading

  <?xml version="1.0" ?>
  <?xml-stylesheet href="docbook-css/driver.css" type="text/css" ?>

to render an arbitrary XML document such as DocBook, but 
what is the equivalent to include javascript and have it execute?

In HTML you would just say 
  <script src="scripts/website.js" type="text/javascript">
or
  <script language="javascript">
  <!--

  // -->
  <script>

I'm sure that javascript could be added in a DocBook element too, but 
how would the browser ever know it had to execute it?

Puzzled.
Doug
← Prev in month ← Prev in thread