Ich habe eine XML wie:Wie nach Zustand die Werte von XML ändern XSLT mit
<all>
<one>Something 1</one>
<two>something 2</two>
<check>
<present>true</present>
</check>
<action>
<perform></perform>
</action>
</all>
Ich möchte XSL XML Transformation durchführen mit:
erwartete Ausgabe: wenn <present>true</present>
all>
<one>Something 1</one>
<two>something 2</two>
<check>
<present>YES</present>
</check>
<action>
<perform>READ</perform>
</action>
</all>
else if: <present>false</present>
<all>
<one>Something 1</one>
<two>something 2</two>
<check>
<present>NO</present>
</check>
<action>
<perform>INSERT</perform>
</action>
</all>
Ist es möglich zu tun? Ich bin nicht bewusst über Zustand XSL bei der Prüfung ich versuche, das Element zu bewegen, aber funktionierte nicht:
<xsl:template match="perform">
<xsl:copy>
<xsl:choose>
<xsl:when test="../check/present = 'true'">
<xsl:text>READ</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:copy>
</xsl:template>
Vielen Dank. Es hat funktioniert –