XML DOM XSLTProcessor 对象

The XSLTProcessor converts XML using XSLT.

XSLTProcessor object

The XSLTProcessor uses XSLT stylesheets to transform XML documents.

Through importStylesheet() methodInitialize it with a stylesheet. If your stylesheet uses parameters, you can use setParameter() to set these parameters. Finally, use transformToDocument() or transformToFragment() to perform the actual transformation.

IE supports XSLT but does not implement the XSLTProcessor object.

Refer to the Node object specific to IE transformNode() and transformNodeToObject() method.

Methods of the XSLTProcessor object

Method Description IE F O W3C
clearParameters() Delete any previously set parameters. No 1 9 Yes
getParameter() Return the value of the specified parameter. No 1 9 Yes
importStylesheet() Specify the XSLT stylesheet to be used. No 1 9 Yes
removeParameter() Delete the specified parameter. No 1 9 Yes
reset() Restore the XSLTProcessor to the default state. No 1 9 Yes
setParameter() Set up stylesheet parameters. No 1 9 Yes
transformToDocument() 把节点或文档转换为新的文档。 No 1 9 Yes
transformToFragment() 把节点或文档转换为 DocumentFragment。 No 1 9 Yes