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

Re: non MS transform

Subject: Re: non MS transform
From: António Mota <xptm@xxxxxxx>
Date: Tue, 21 Dec 2004 17:18:51 +0000
transformnode mozilla
With sarissa is as simple as this:

var xml = Sarissa.getDomDocument();
xml.async = false
xml.load("cdcatalog.xml")

// Load XSL
var xsl = new Sarissa.getDomDocument();
xsl.async = false
xsl.load("cdcatalog.xsl")

// Transform
var xmlResult = Sarissa.getDomDocument();
xml.transformNodeToObject(xsl, xmlResult);
document.getElementById("some-id").appendChild(document.importNode(xmlResult
.documentElement, true));

It works with IE, FF and at least two other linux browsers, so they told
me...

Quoting Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>:

> Hi Jeff,
>
> At 11:26 AM 12/21/2004, you wrote:
> >Howdy.  I was happy as a clam with
> ><html>
> ><body>> ><script type="text/javascript">
> >// Load XML
> >var xml = new ActiveXObject("Microsoft.XMLDOM")
> >xml.async = false
> >xml.load("cdcatalog.xml")
> >
> >// Load XSL
> >var xsl = new ActiveXObject("Microsoft.XMLDOM")
> >xsl.async = false
> >xsl.load("cdcatalog.xsl")
> >
> >// Transform
> >document.write(xml.transformNode(xsl))
> ></script>
> >
> ></body>
> ></html>
> >
> >But then I was told that I had to come up with a non Microsoft approach. I
> >thought that would be easy but my searching has not been successful.
> >
> >Could someone be so kind as to provide me with a "standard" solution to
> >transforming.
>
> This code is to configure a transformation to run in the client. (IE, on a
> Microsoft platform. Hence the potential problem.)
>
> Since there is actually a variety of web browsers available, and most of
> them do not support XML/XSLT at all, a general solution for all browsers
> isn't possible. This is a primary reason why many projects opt to transform
> on the server, or by pre-processing files in batch mode. In such a case you
> get many or most of the advantages of the layered XML architecture, without
> the browser dependencies (since they only see HTML).
>
> In simple cases, you can place an <?xml-stylesheet href="..." ?> PI (google
> this) in your XML documents and serve them directly: both IE and
> Mozilla-based browsers will recognize the PI and apply a transformation
> accordingly.
>
> If you want something more dynamic but still "standard" on the client, you
> could look at sarissa (http://sarissa.sf.net). From their Overview page:
>
> >Sarissa is a JavaScript meta-API. It bridges the gap of DOM XML extentions
> >between Internet Explorer and Mozilla (or Moz-based) browsers. It is an
> >effort to provide a common interface for those extentions, bringing them
> >closer to eachother. It was originally created to protect my sanity ;-)
> >
> >Sarissa implements some of the DOM standard and Mozilla extentions for IE
> >and some IE extentions for Mozilla. Finally, it provides some factory
> >methods, for both browsers.
>
> Of course, sarissa is not "standard" -- although as an open-source project,
> it's non-proprietary.
>
> Cheers,
> Wendell
>
>
>
> ======================================================================
> Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
> Mulberry Technologies, Inc.                http://www.mulberrytech.com
> 17 West Jefferson Street                    Direct Phone: 301/315-9635
> Suite 207                                          Phone: 301/315-9631
> Rockville, MD  20850                                 Fax: 301/315-8285
> ----------------------------------------------------------------------
>    Mulberry Technologies: A Consultancy Specializing in SGML and XML
> ======================================================================
>
>





O SAPO ja esta livre de vmrus com a Panda Software, fique vocj tambim!
Clique em: http://antivirus.sapo.pt

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.