Re: [xsl] Re: XSL in HTML

Subject: Re: [xsl] Re: XSL in HTML
From: "Alex Hildyard" <alexhildyard@xxxxxxxxxxx>
Date: Wed, 19 Nov 2003 21:07:00 -0000
I don't know what browser you are using, but I do know you can do this in
recent versions of IE (I think you need IE5 or higher, but don't quote me on
this).

FYI, have a look at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk30/htm/xmmthtransformnode.asp

This includes the following script, which loads an XML file and an XSL
stylesheet, applies the transformation, then inserts the resultant document
into the HTML file -- which I believe is what you require.

<SCRIPT>
  // Load data.
  var source = new ActiveXObject("Msxml2.DOMDocument");
  source.async = false;
  source.resolveExternals = false;
  source.load("books.xml");

  // Load style sheet.
  var stylesheet = new ActiveXObject("Msxml2.DOMDocument");
  stylesheet.async = false;
  stylesheet.resolveExternals = false;
  stylesheet.load("sample.xsl");

  // Fill a div tag with the result of the transform
  divInfo.innerHTML = source.transformNode(stylesheet);
</SCRIPT>
BTW -- again, I'm speaking for IIS -- there's no reason you can't use
Javascript on the server and perform the transformation with ASP or
something similar, thus passing HTML to the client.

My knowledge of Apache is non-existent, however :)

Best wishes,

Alex



----- Original Message ----- 
From: <yguaba@xxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, November 19, 2003 5:08 PM
Subject: [xsl] Re: XSL in HTML


> Hello Vishnu,
>
> On 19 Nov 2003 at 2:30, Vishnu Vardan wrote:
>
> > (...) my requirement is to have one HTML file and it should process the
> > xml with the xsl embedded in it and show the detail in that HTML.  I
> > doubt whether it is possible.  Please let me know if it is possible.
>
> I don't think you can do that, but my knowledge of XSLT and related
> technologies pales in comparison to that of some of our colleagues on
> this list (Michael Kay, Dimitre Novatchev, David Carlisle etc). Our
> friend The Bat has already replied to your message saying everything
> that I was going to say. I also use PHP to transform XML into HTML
> via XSLT, so I suggest you follow the Bat's suggestions.
>
> Take care,
>
> Erik
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread