<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="iso-8859-1"/>
<xsl:template match="/">
<methodResponse>
<xsl:choose>
<xsl:when test="/ROOT/FAULT = 1">
<fault>
<value>
<struct>
<member>
<name>faultcode</name>
<value><int><xsl:value-of select="/ROOT/ERROR/CODE" /></int></value>
</member>
<member>
<name>faultstring</name>
<value><string><xsl:value-of select="/ROOT/ERROR/MESSAGE" /></string></value>
</member>
</struct>
</value>
</fault>
</xsl:when>
<xsl:otherwise>
<params>
<xsl:for-each select="/ROOT/RESPONSE/*">
<param>
<xsl:copy-of select="." />
</param>
</xsl:for-each>
</params>
</xsl:otherwise>
</xsl:choose>
</methodResponse>
</xsl:template>
</xsl:stylesheet>
|