超全模态模型 × Harness 升级,升级解锁 ArkClaw,最新支持 DeepSeek-V4 系列与 GLM-5.1
假设你的XML结构如下(符合需求场景):
<root> <items> <item>101</item> <item>102</item> <item>103</item> <!-- 目标匹配的ID值 --> <VIP>Yes</VIP> </items> <objects> <object ID="101" name="Object A"/> <object ID="103" name="Object C"/> <!-- 符合匹配条件的元素 --> <object ID="102" name="Object B"/> </objects> </root>
下面的样式表可实现需求,核心是通过变量存储目标ID和VIP值,再精准筛选匹配的<object>:
<object>
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes"/> <!-- 存储第三个<item>的ID值 --> <xsl:variable name="target-id" select="/root/items/item[3]/text()"/> <!-- 存储对应的VIP状态 --> <xsl:variable name="vip-status" select="/root/items/VIP/text()"/> <xsl:template match="/"> <html> <body> <table border="1"> <tr> <th>ID</th> <th>Name</th> <th>VIP</th> </tr> <!-- 筛选ID属性等于目标ID的<object>元素 --> <xsl:for-each select="/root/objects/object[@ID = $target-id]"> <tr> <td><xsl:value-of select="@ID"/></td> <td><xsl:value-of select="@name"/></td> <td><xsl:value-of select="$vip-status"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>
<item>
<VIP>
@ID = $target-id
/root/objects
<items>
运行上述XSLT后,会生成如下表格:
<html> <body> <table border="1"> <tr> <th>ID</th> <th>Name</th> <th>VIP</th> </tr> <tr> <td>103</td> <td>Object C</td> <td>Yes</td> </tr> </table> </body> </html>
内容的提问来源于stack exchange,提问作者Mulder
超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起
模型再升级,30秒超长叙事, 模态参考扩容
模型自由,工具不限,最新支持 Deepseek-V4 系列、GLM-5.3 系列
超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列
大模型19元起,Al应用9.9元畅享,新人首购爆款尽享优惠