Process input parameters using the XSLT parameter assignment mechanism

Source: Internet
Author: User
Tags xslt

In the XSLT template, the format of a parameter nodeid is defined as follows:

<XSL: Param name = "nodeid"/>

Generally, the value of the nodeid parameter is in the *** format, and there is no error in using this parameter. However, in some special cases, the format of the passed nodeid parameter is ****, * *** format. In this case, you only need to capture the content before the first Separator in the nodeid. Finally, find the solution to the file, that is, define another parameter, assign the nodeid value to this parameter, and process it during the value assignment process. As shown below:

<XSL: variable name = "arraynodeid" select = "substring-before ($ nodeid, ',')"/>

In the process of XSLT programming, you only need to judge the arraynodeid, as shown below:

<XSL: Choose> <XSL: When test = "$ arraynodeid! = ''"> <XSL: value-of select = "$ arraynodeid"/> </XSL: When> <XSL: otherwise> <XSL: value-of select = "$ nodeid"/> </XSL: otherwise> </XSL: Choose>

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.