Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
 XSLT Extension Objects

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework Developer's Guide 
XSLT Extension Objects 

Extension objects are used to extend the functionality of style sheets. Extension objects are maintained by the XsltArgumentList class.

The following are advantages to using an extension object rather than embedded script:

  • Provides better encapsulation and reuse of classes.

  • Allows style sheets to be smaller and more maintainable.

XSLT extension objects are added to the XsltArgumentList object using the AddExtensionObject method. A qualified name and namespace URI are associated with the extension object at that time.

NoteNote

The FullTrust permission set is required to call the AddExtensionObject method. For more information, see Code Access Security and Named Permission Sets.

The data types returned from extension objects are one of the four basic XPath data types of number, string, Boolean, and node set.

Any method that is defined with the params keyword, which allows an unspecified number of parameters to be passed, is not currently supported by the XslCompiledTransform class. XSLT style sheets that utilize any method defined with the params keyword will not work correctly. For details, see params (C# Reference).

To use an XSLT extension object

  1. Create an XsltArgumentList object and add the extension object using AddExtensionObject method.

  2. Call the extension object from the style sheet.

  3. Pass the XsltArgumentList object to the Transform method.

See Also

Tags What's this?: xml (x) xslt (x) Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker