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

Re: tableheader sort on date with DOM dynamically and

Subject: Re: tableheader sort on date with DOM dynamically and optimisation xslt/xml code
From: "Carsten Klein" <carstenklein@xxxxxxxx>
Date: Mon, 8 Apr 2002 16:24:49 +0200
msxml2.domdocument sort
Hi Hans,

well, the example given was not that complicated and as far as I get
your point straight,
you are using msxml ActiveX object when using

Or are you using data isles? Do they permit the use of
transformNode()? If so, my lack of knowledge.

: output.innerHTML = xmlDoc.documentElement.transformNode(xslDoc);

Hm, this is a good point, replacing the innerHTML, since this is not
standard html.

But, since transformNode does not return an object other than String
you will need to use a
different method...

Here is a script snippet I got from
http://msdn.microsoft.com/library/en-us/xmlsdk/htm/xml_mth_sz_2jp0.a
sp

Hope they don't mind, me quoting this one.

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

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

  // Set up the resulting document.
  var result = new ActiveXObject("Msxml2.DOMDocument.4.0");
  result.async = false;
  result.validateOnParse = true;

  // Parse results into a result DOM Document.
  source.transformNodeToObject(stylesheet, result);
</SCRIPT>

As you can see, this will create a DOM document (fragment) by
writing the object
to variable result. I don't know if you have to provide an instance
of a MSXML DOMDocument
or you may setup an empty variable and write the transformation
result to this variable. If it does, you
may then add this to the dom using

    var result = null;
    xmlDoc.documentElement.transformNodeToObject(xslDoc, result);
    document.getElementById("InsertHere").appendChild(result);

But since the innerHTML attribute is supported by nearly(?) all user
agent implementations, this
should not be that much of a problem. Except when the user has
disabled writing to the document from script.
But I don't know if this does not imply, too, that creating element
nodes and inserting these nodes to the
dom will be disabled as well.

And, yes, a user may certainly include your site to his trusted
sites list.
A bit complicated for the user to manage, though.

Hope this helps,

Carsten


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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


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.