Section 25.335. XSLTProcessor: transform XML with XSLT stylesheets


25.335. XSLTProcessor: transform XML with XSLT stylesheets

Firefox 1.0, Safari 2.01, Opera 9: Object XSLTProcessor

25.335.1. Constructor

 new XSLTProcessor( ) 

25.335.2. Methods


clearParameters( )

Deletes any previously set parameters.


getParameter( )

Returns the value of a named parameter.


importStyleSheet( )

Specifies the XSLT stylesheet to be used.


removeParameter( )

Deletes a named parameter.


reset( )

Resets the XSLTProcessor to its initial state, clearing all parameters and stylesheets.


setParameter( )

Sets a named parameter to a specified value.


transformToDocument( )

Transforms the specified document or node using the stylesheet passed to importStylesheet( ) and parameters passed to setParameter( ). Returns the result as a new Document object.


transformToFragment( )

Transforms the specified document or node, returning the result as a DocumentFragment.

25.335.3. Description

The XSLTProcessor transforms XML document nodes using XSLT stylesheets. Create an XSLTProcessor object with the no-argument constructor, and initialize it with an XSLT stylesheet with the importStylesheet( ) method. If your stylesheet uses parameters, you can set those with setParameter( ). Finally, perform an actual XSL transformation with TRanformToDocument( ) or transformToFragment( ).

Internet Explorer supports XSLT but does not implement the XSLTProcessor object. See the IE-specific transformNode( ) and transformNodeToObject( ) methods of Node, and see Chapter 21 for XSLT examples and cross-platform utility functions.

25.335.4. See Also

Node.transformNode( ), Node.transformNodeToObject( ); Chapter 21




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net