开发者

XSLT - Transform the value of an attribute to a tagname

开发者 https://www.devze.com 2023-01-06 00:38 出处:网络
I have been looking for a while and I do not understand how I can do something like this: From <computer type=\"laptop\">

I have been looking for a while and I do not understand how I can do something like this:

From

<computer type="laptop"> .... </computer>

To

<laptop>
....

In fact as you can see I want to transform the value of an attribute to a tagname, I开发者_运维百科 do not even know if it is possible.

Thank you


Use the xsl:element element. With this, you can create an element with any name you choose. e.g.

<xsl:element name="{@type}">
...
</xsl:element>
0

精彩评论

暂无评论...
验证码 换一张
取 消