First, all XSLT processors must include four built-in template rules that are less prioritized than any other rule, so you can overwrite them by writing a new template rule to match the same style. The best way to understand the built-in rules is to set them up always in the background and apply these built-in rules if no other rule is found that matches one node.
If
Simply adding a predicate to filter the result node set usually reduces the size of the result set. Additional predicates can be added for additional filtering. For example, Child::recipient[position () =1] initially selects all <recipient> elements from the previous instance and then filters down (reduces) the list until the first: Burke_ The e@ociWeb.com position starts at 1 instead of 0. Predicates can contain any XPath expression and become quite complex.
<xsl:apply-templates select= "presidents/president/name[child::first= ' John '"/>
<xsl:apply-templates
Select= "presidents/president[(term/@from > 1800) and (term/@from < 1850)]/name" >
Three, sort
Sorting can be applied to data drivers or to template-driven methods. In either case, <xsl:sort> is added as a child element to the other part. Multiple-field sorting can be done by adding several contiguous <xsl:sort> elements. Each sort can be in ascending and descending order, and the data type used for sorting can be either "number" or "text." sorting defaults to Ascending.
As long as we need to treat an attribute value as an XPath expression rather than static text, we may need to use a AVT. However, for standard XSLT elements, such as <xsl:template match= "pattern"/>, you do not have to use the AVT syntax. For non-XSLT elements, such as arbitrary HTML tags, AVT syntax is required.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.