xsl-list
[Top] [All Lists]

RE: Any samples of client-side XSLT to generate webpages?

2004-07-26 23:25:52
Hmmm... yes, there should be a doctype decleration.  Page is still beta -
thanks for picking that out.

-----Original Message-----
From: Daniel Joshua [mailto:daniel(_dot_)joshua(_at_)gridnode(_dot_)com]
Sent: Monday, July 26, 2004 10:40 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Any samples of client-side XSLT to generate webpages?


Thanks for your post.

Not exactly what I was looking. I am looking for pages that do the XSLT
in the client's web browser.

Also, I noticed that your HTML has no DOCTYPE?

eg.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

Isn't it recommended to add a DOCTYPE?


Regards,
Daniel


-----Original Message-----
From: Karl J. Stubsjoen [mailto:karl(_at_)meetscoresonline(_dot_)com]
Sent: Tuesday, 27 July, 2004 1:36 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Any samples of client-side XSLT to generate webpages?


Sorry Daniel,

All of my examples are using MSXML Dom on an IIS Server.  I do have examples
of XSLT that kicks out forms and persists form values... but again, on a
different platform, and I don't do "document.myForm.Submit()".

Here it is if you are interested:
http://www.meetscoresonline.com/entry/

The XSLT:
http://www.meetscoresonline.com/entry/documents/entry_template.xsl

Karl


-----Original Message-----
From: Daniel Joshua [mailto:daniel(_dot_)joshua(_at_)gridnode(_dot_)com]
Sent: Monday, July 26, 2004 10:19 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Any samples of client-side XSLT to generate webpages?


Hi all,

I have not get any samples from anyone on the list yet.



Well here is what I done so far. As you can see I need help making it work
in both IE and Mozilla.

http://202.156.224.29:18080/shatteredspace/news.do (work on IE only)

http://202.156.224.29:18080/shatteredspace/news.do?transform=true (works on
Mozilla only - currently need to manually add the '?transform=true', but I
might automate this later)



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

  protected void writeDocument()
  {
    try
    {
      boolean transform =
ConversionUtils.primitiveBooleanValue(_request.getParameter(PARAM_TRANSFORM)
);
      if(transform)
      {
        InputStream inputStream =
_request.getSession().getServletContext().getResourceAsStream("stylesheets/"
+ _stylesheet);

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

        //TODO: Add Caching
        TransformerFactory transformerFactory =
TransformerFactory.newInstance();
        Transformer transformer = transformerFactory.newTransformer(new
StreamSource(inputStream));
        transformer.transform(new JDOMSource(_document), new
StreamResult(_response.getOutputStream()));
      }
      else
      {
        _document.addContent(0, new ProcessingInstruction("xml-stylesheet",
"type=\"text/xsl\" href=\"stylesheets/" + _stylesheet + "\""));

        _response.setContentType("text/xml");

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

Any help/suggestions/links/samples would be greatly appreciated. Thanks.


Regards,
Daniel
http://www.shatteredspace.net


-----Original Message-----
From: Daniel Joshua [mailto:daniel(_dot_)joshua(_at_)gridnode(_dot_)com]
Sent: Monday, 26 July, 2004 12:46 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Any samples of client-side XSLT to generate webpages?


Hi all,

I am looking for samples (hopefully as part of a web site)
of web pages that use XSLT in a browser to generate the HTML
that is displayed.

Best would be pages that have forms. As I am encountering a problem
trying to submit a form in Mozilla using 'document.myForm.submit()'.
When I did a alert() to see the value of 'document' it returned
'XMLDocument' and 'document.forms' returned 'undefined'.

Currently, it works in IE using client-side transformation
(ContentType: "text/xml") and in Mozilla using server-side
transformation (ContentType: "text/html").

Also, I noticed in Mozilla's DOM Inspector that my '#document' had
two 'html' child nodes, the first was blank and the second had the
'head' and 'body' nodes and the namespace 'http://www.w3.org/1999/xhtml'.
Any idea for this extra 'html' node?

I really would like to examine how other people do XSLT in browsers,
thus the reason I am looking for samples. Or should I do all my
transformation on the server-side?

By the way, I am using Mozilla 1.8a2 and IE 6.0.


Regards,
Daniel



--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--



--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--



--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--



--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--