1. How to Use call-template? How do I pass parameters and define return values?
A: The XSL: withparam element is used in the call-template field to define the parameters to be passed and the XSL: Param Parameter definition form parameter is defined in the called template.
2. How do I convert the input file namespace to the output file?
Use the XSL: namespace-alias element.
3. How does apply-templates select the template? Is it based on the element name, not the Template Name?
As follows:
<XSL: template match = "message" name = "message">
<H1> <XSL: Apply-templates select = "title"/>
</XSL: Template>
<XSL: template match = "title" name = "title">
<! -- XSL content -->
</XSL: Template>
In addition, if the title processing template is not defined, what is the default processing method?
A: Apply-templates is a processing template for all child elements of the current parent element.
If no processing template is defined, the default behavior is: none.
4. In the same XSL style sheet file, how does the XSLT processor find the one to execute XML Conversion?
For example, in the above example, the title element can be processed from the message template (The apply-templates tag is used), but the template title can also be used for processing?
A: The XSL processing and conversion engine matches the source XML document top-down, from external to internal, with each template, and then selects an appropriate processing template to convert the source XML document. That is to say, nodes processed in the source XML file are no longer processed by other processing templates (unless called multiple times, for example, differentiated by mode ).
5. How do I deal with nodes that do not define a processing template?
A: By default, the text information of nodes is displayed in order.
6. How do I define not to process a node and its children?
A: Use <XSL: template match = "XPath"/>, so that even if a processing template is defined for its child nodes, it will not be called.