Xsl call template inside xsl for each




















Font-size: A A A. The xsl:call-template element is used to invoke a template by name. By invoke, we mean that the named template is called and applied to the source document. If a template does not have a name, it cannot be called by this element.

The xsl:template element is used to create a template. If the select attribute is not defined, the parameter defaults to an empty string. The following example creates a template named my-template and defines three parameters, one of which defaults to the string false, and one of which defaults to the contents of the element node named name that is a child of the current context node. If the script calls the template and does not pass in a parameter, the default value is used.

The name attribute is required and defines the name of the template being called. If you do not define a value for the parameter in the calling environment, the script passes in the current value of the parameter if it was previously initialized, or it generates an error if the parameter was never declared.

For more information about passing parameters. In the following example, the template my-template is called with the parameter c containing the contents of the element node named other-name that is a child of the current context node.

This example creates a block for a chapter element and then processes its immediate children. In the absence of a select attribute, the xsl:apply-templates instruction processes all of the children of the current node, including text nodes. Forgot Password? This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy.

By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy. XSLT Loop. Free Software Development Course. Login details for this Free course will be emailed to you. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.

Related Hot Network Questions. Question feed.



0コメント

  • 1000 / 1000