Re: Newbie, HTML calling XSLT




Peter Flynn wrote:
> Clive wrote:
>
> > For an exercise, I would like to write a simple HTML page that calls
> > XSLT and passes it parameters.
>
> You can't do this with [original] HTML -- your page must be XHTML (or any
> other flavour of XML) because XSLT 1.0 only processes XML. The original
> HTML is written in SGML, not XML, and that won't work with XSLT.

That's a misleading statement. You can't "work with XSLT" from within
HTML because you need scripting (HTML isn't a programming language),
not because it's not XML (and so would need XHTML). If you have
JavaScript and some XML scripting tools, then you can use XSLT from
_within_ HTML perfectly well.

You can't process HTML as _input_ to XSLT because it's not XML -- but
that's a totally different question.

You can make HTML from XSLT easily, because this was an obvious
use-case for XSLT and so there's an option to support it (look at
<xsl:output ... /> )

As for the "scripting" case, then this works very well (and with HTML),
but you need to have a "modern" browser. It may work for intranets or
local demonstrations, but you should be careful putting such a thing
onto the public web and expecting it to work for everyone.

.



Relevant Pages

  • Re: Newbie, HTML calling XSLT
    ... I would like to write a simple HTML page that calls ... > XSLT and passes it parameters. ... other flavour of XML) because XSLT 1.0 only processes XML. ... > programming language like Perl or php to achieve this? ...
    (comp.text.xml)
  • Re: XHTML Doctype?
    ... One friend has said "but you just use XSLT to translate it into ... HTML -- that's not really serving XML, ...
    (comp.text.xml)
  • Zeichenkodierung der Ausgabe beim "href" Attribut
    ... mit Hilfe von LibXSLT wird eine HTML Seite in ISO-8859-1 Kodierung ... Nun ist ein Link auf eine Datei hinzugekommen, ... Der Dateiname steht im XML Dokument. ... Aus irgendeinem Grund scheint der XSLT Prozessor -- ich habe auch Xalan ...
    (de.comp.text.xml)
  • Re: cloneNode/appendChild and children
    ... It seems rather pointless to use XSLT to convert XML to XML. ... When, for instance, the server has finished sending all users. ... (insert the HTML as the innerHTML of a div to convert it to a DOM ...
    (comp.lang.javascript)
  • Re: Query XML file
    ... See this link for a very simple example of XML to HTML table using XSLT in a few ... lines of ASP. ... If you need to restrict the content output then look at passing a parameter value to the XSLT ...
    (microsoft.public.scripting.vbscript)