我对 XSLT 非常陌生,并且对前进有一些帮助。我能够使用 XSL 仅获取错误的成功值,但要获取 output.xml 中显示的所有 QUEID 值作为列表,我无法继续。任何帮助将不胜感激。
XSL
=========
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:variable name="gb"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="//Entity[success='true']"/>
</xsl:stylesheet>
Input XML
==============
<?xml version="1.0"?>
<Entities>
<Entity>
<Type/>
<QUEID>14077317</QUEID>
<ENUM>95299168</ENUM>
<success>false</success>
</Entity>
<Entity>
<Type/>
<QUEID>14077319</QUEID>
<ENUM>95299151</ENUM>
<success>false</success>
</Entity>
<Entity>
<Type/>
<QUEID>14077320</QUEID>
<ENUM>95299154</ENUM>
<success>true</success>
</Entity>
<Entity>
<Type/>
<QUEID>14077328</QUEID>
<ENUM>95299164</ENUM>
<success>false</success>
</Entity>
<Entity>
<Type/>
<QUEID>14077329</QUEID>
<ENUM>95299147</ENUM>
<success>true</success>
</Entity>
</Entities>
Desired Output XML
===================
<?xml version="1.0"?>
<Entities>
<Entity>
<Type/>
<QUEID>102</QUEID>
<ENUM>98</ENUM>
<success>true</success>
</Entity>
<Entity>
<Type/>
<QUEID>104</QUEID>
<ENUM>67</ENUM>
<success>true</success>
</Entity>
<EntityList>102,104</EntityList>
</Entities>