[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Any samples of client-side XSLT to generate webpag

Subject: RE: Any samples of client-side XSLT to generate webpages?
From: "Daniel Joshua" <daniel.joshua@xxxxxxxxxxxx>
Date: Tue, 27 Jul 2004 23:14:39 +0800
sarissa mime
Yes. That is what I am trying to do. I even posted the code I used to do it
in an earlier email on the list in hope someone could spot my mistake.


Can anyone explain to me why the below happens:

  - works in IE
  - unable to submit form in Mozilla

  - works in Mozilla - currently need to manually add the '?transform=true',
but I might automate this later
  - nothing visible (except background graphic) in IE

Here's the code that either (1) writes out XML with a XSLT stylesheet or
(2) uses saxon to transform into HTML.

  protected void writeDocument()
      boolean transform =
        InputStream inputStream =
+ _stylesheet);

        //_response.setContentType("'application/xhtml+xml"); // currently
most browsers do not support this yet

        //TODO: Add Caching
        TransformerFactory transformerFactory =
        Transformer transformer = transformerFactory.newTransformer(new
        transformer.transform(new JDOMSource(_document), new
        _document.addContent(0, new ProcessingInstruction("xml-stylesheet",
"type=\"text/xsl\" href=\"stylesheets/" + _stylesheet + "\""));


        XMLOutputter xmlOutputter = new
        xmlOutputter.output(_document, _response.getWriter());
    catch(Exception ex)
      throw new NestableRuntimeException("Failed to write document", ex);

> Make sure your server or servlet/whatever is configured to send the
> right MIME type to the browser...

I believe I am using the right mime type, correct me if I am wrong. :p


-----Original Message-----
From: Emmanouil Batsis [mailto:Emmanouil.Batsis@xxxxxxxxxxx]
Sent: Tuesday, 27 July, 2004 10:19 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Any samples of client-side XSLT to generate webpages?

Daniel Joshua wrote:

>Ok, I understand this now.
>If I ever need to produce HTML fragments I will use Sarissa (I find how it
>works very intersting). But the approach I am currently trying is to
>whole HTML pages by XSLT transformation in the client's browser.

Why dont you just send XML with an stylesheet PI to the  browser then?
Make sure your server or servlet/whatever is configured to send the
right MIME type to the browser...



Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.