您的位置:首页 > Web前端

XSLT Reference

2006-05-09 14:35 113 查看
The XSLT elements from the W3C Recommendation (XSLT Version 1.0).

XSLT Elements

The links in the "Element" column point to attributes and more useful information about each specific element.

NN: indicates the earliest version of Netscape that supports the tag
IE: indicates the earliest version of Internet Explorer that supports the tag

Note: Elements supported in IE 5.x may have NON-standard behavior, because IE 5.x was released before XSLT became an official W3C Recommendation. However, IE 6.x has full XML / XSLT 1.0 / XPath 1.0 support!

ElementDescriptionIENN
apply-importsApplies a template rule from an imported style sheet6.0
apply-templatesApplies a template rule to the current element or to the current element's child nodes5.06.0
attributeAdds an attribute5.06.0
attribute-setDefines a named set of attributes6.06.0
call-templateCalls a named template6.06.0
chooseUsed in conjunction with <when> and <otherwise> to express multiple conditional tests5.06.0
commentCreates a comment node in the result tree5.06.0
copyCreates a copy of the current node (without child nodes and attributes)5.06.0
copy-ofCreates a copy of the current node (with child nodes and attributes)6.06.0
decimal-formatDefines the characters and symbols to be used when converting numbers into strings, with the format-number() function6.0
elementCreates an element node in the output document5.06.0
fallbackSpecifies an alternate code to run if the processor does not support an XSLT element6.0
for-eachLoops through each node in a specified node set5.06.0
ifContains a template that will be applied only if a specified condition is true5.06.0
importImports the contents of one style sheet into another. Note: An imported style sheet has lower precedence than the importing style sheet6.06.0
includeIncludes the contents of one style sheet into another. Note: An included style sheet has the same precedence as the including style sheet6.06.0
keyDeclares a named key that can be used in the style sheet with the key() function6.06.0
messageWrites a message to the output (used to report errors)6.06.0
namespace-aliasReplaces a namespace in the style sheet to a different namespace in the output6.0
numberDetermines the integer position of the current node and formats a number6.06.0
otherwiseSpecifies a default action for the <choose> element5.06.0
outputDefines the format of the output document6.06.0
paramDeclares a local or global parameter6.06.0
preserve-spaceDefines the elements for which white space should be preserved6.06.0
processing-instructionWrites a processing instruction to the output5.06.0
sortSorts the output6.06.0
strip-spaceDefines the elements for which white space should be removed6.06.0
stylesheetDefines the root element of a style sheet5.06.0
templateRules to apply when a specified node is matched5.06.0
textWrites literal text to the output5.06.0
transformDefines the root element of a style sheet6.06.0
value-ofExtracts the value of a selected node5.06.0
variableDeclares a local or global variable6.06.0
whenSpecifies an action for the <choose> element5.06.0
with-paramDefines the value of a parameter to be passed into a template6.06.
XQuery 1.0, XPath 2.0, and XSLT 2.0 share the same functions library.

XSLT Functions

XSLT includes over 100 built-in functions. There are functions for string values, numeric values, date and time comparison, node and QName manipulation, sequence manipulation, Boolean values, and more.

The URI of the XSLT function namespace is: http://www.w3.org/2005/02/xpath-functions
The default prefix for the function namespace is fn:.

Tip: Functions are often called with the fn: prefix, such as fn:string(). However, since fn: is the default prefix of the namespace, the function names do not need to be prefixed when called.

The reference of all the built-in XSLT 2.0 functions is located in our XPath tutorial.

In addition, there are the following built-in XSLT functions:

NameDescription
current()Returns the current node
document()Used to access the nodes in an external XML document
element-available()Tests whether the element specified is supported by the XSLT processor
format-number()Converts a number into a string
function-available()Tests whether the function specified is supported by the XSLT processor
generate-id()Returns a string value that uniquely identifies a specified node
key()Returns a node-set using the index specified by an <xsl:key> element
system-property()Returns the value of the system properties
unparsed-entity-uri()Returns the URI of an unparsed entity
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: