Because only one template can be processed with any node, the processor must choose between competing templates for the same node. Using themodeattribute is one way of explicitly assigning a template to a specific node. Explain the default priority number rules used by an XSLT processor to determine template priority.

What will be an ideal response?


The XSLT processor assigns a priority number to each template it encounters; templates assigned to the same node set that have a higher priority number are given precedence over templates that have lower-priority numbers. The default priority numbering uses the following rules:Templates with paths that match nodes based on their context in the source document, such as the location path property/city, have a priority number of +0.5. These templates have the greatest priority.Templates with paths that match nodes specifically by name, such as the location path city, have a priority number of 0.Built-in templates and templates with location paths that match a class of nodes, such as with the wildcard (*) character, have a priority number of -0.5. These templates have the lowest priority.If two templates have the same priority number, the last one defined in the style sheet is the one applied by the processor. You can also use the priority attribute to define your own priority numbers. Thus, the following template:has a priority of 2 and will be given precedence over any template with a lower priority. To avoid confusion when using multiple templates that could be assigned to the same node, you should always use either the mode attribute or the priority attribute.

Computer Science & Information Technology

You might also like to view...

Process inks are made by combining different percentages of one or more of the four colors used in process printing.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

When working with a linked list, besides an end-of-list sentinel value, a special pointer must be provided for storing the address of the ____________________ structure in the list.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

____ is the PC operating system designed for Apple computers.

A. Windows B. macOS C. Linux D. Chrome OS

Computer Science & Information Technology

Creating finished goods and services using raw materials and personnel pertains to which of the following functions?

A. marketing B. production C. human resources D. research

Computer Science & Information Technology