XML – Assign strings to variables according to conditions in XSLT

If a specific attribute returns a specific value, I want to assign a value to the variable. Here, if pr: all / [@ pr: name = current()/ @ cx: name] / pr: properties /(@ ls:middlename) is “cengie”, I want to assign the value “young” to the variable “person” “. Is that possible?

  name='person' select='pr:all/[@pr:name=current()/@cx:name]/pr:properties/(@ls:middlename)'>

You can put any xslt code in xsl:variable , And assign the result to a variable. In this case, you can use xsl:if to check your condition

 

young

If you want to use’else’ here, You can use xsl:choose instead.

If a specific attribute returns a specific value, I want to assign a value to the variable. Here, if pr:all / [@ pr:name = current()/ @ cx: name] / pr: properties / (@ ls: middlename) is “cengie”, I want to assign the value “young” to the variable “person”. Is that possible?

 name='person' select='pr:all/[@pr:name=current()/@cx: name]/pr:properties/(@ls:middlename)'>

You can put any xslt code In the xsl: variable, and assign the result to the variable. In this case, you can use xsl: if to check your condition

 

young

If you want to be here Using’else’, you can use xsl: choose instead.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 6018 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.