Re: Hypermedia & web architecture

On 28/07/2012 12:26, Rushforth, Peter wrote:
>

>> Also as Liam noted javascript is only available if your host
>> document is (x)html, it isn't available if you just serve some
>> other xml type.
>
> Why?

Why? because to to trigger javacsript processing you need an html or
xhtml or svg <script> element. So if you want to push javascript as a
method of adding functionality _without_ getting agreement from the
browser implementers to implement new native functionality you need to
host the document in html. You can serve an html document that contains
(say) ChemML as inert markup in one script element and some javascript
in another script element that parses it and processes it in some way
but the host document (and thus the mime type of the thing) has to be
text/html even if it just consists of the xml markup of chemML and a
script element to process it.
>
>> so I don't understand the point you are making here at all.
>
> The point is that the discussion needs to be centred around the
> interactions between the client and server, and how the media types,
> and yes links between them, are involved in that interaction.

If you want that interaction to be controlled by javascript then the
controlling media type has to be one of the ones for which browsers
implement script processing, so html, basically.

>
>> Isn't that what <?xml-styleheet spec is for? How does anything
>> discussed here help the XSLT case? which is exactly the behaviour
>> they do all implement for xml-stylesheet PI.
>
> Why is a processing instruction necessary?

Because that is the mechanism specified for XML. You suggested a <link>
element but <link> is _HTML_ It would have been wrong for an XML
stylesheet spec to pre-allocate an element name link for the same
reasons it would be wrong for an xml hypertext spec to pre-allocate an
attribute name href. So the core XML WG did not do that:-)

 > And, can I run an XSLT 2
> stylesheet with that facility?

Indirectly yes, see saxon-ce (internally it uses an xslt 1 stylesheet
loaded by the browser which just loads a stub html document with a
script element that loads the (javasript implementation of) the XSLT2
engine.
>
> Peter
>

David

Received on Saturday, 28 July 2012 13:58:37 UTC