Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

XSLDocument property

Retrieves a reference to the top-level node of the Extensible Stylesheet Language (XSL) document.



oXSL = object.XSLDocument


Property values

Type: Object

a reference to the root node of the style sheet document.


You can use the XSLDocument property to access the Document Object Model (DOM) for the XSL style sheet. For more information, refer to the XML DOM overview.


This example uses the XSLDocument property to access the DOM for the XSL and change attributes representing sort keys.

function sort(key) {
  // Find the "order-by" attributes in the style sheet.
  var s = document.XSLDocument.selectNodes("*/xsl:template[@match='menu']
  // Replace the values with the new sort key.
  for (var i = s.nextNode(); i != null; i = s.nextNode())
    i.value = key;
  // Find the subset of the document we need to update.
  var d = document.XMLDocument.selectSingleNode("story/menu");
  // Apply the style sheet to the subset, and update the display.
  menu.innerHTML = d.transformNode(document.XSLDocument);

See also




© 2017 Microsoft