Sorry for the delay.
There is extra output for failure, but not for success. So you'll have to put in a conditional statement. The choose command will test if there is any contents (reply message) from the executed vairable "result".
<xsl:template match="/">
<op-script-results>
<xsl:variable name="rpc">
<file-copy>
<source>/config/juniper.conf.gz</source>
<destination>ftp://username:password@x.x.x.x/router-config.gz</destination>
</file-copy>
</xsl:variable>
<xsl:variable name="result" select="jcs:invoke($rpc)"/>
<output>
<xsl:choose>
<xsl:when test="$result/message">
<xsl:value-of select="$result/message"/>
</xsl:when>
<xsl:otherwise>FTP'd Successfully</xsl:otherwise>
</xsl:choose>
</output>
</op-script-results>
</xsl:template >
A true condition will reply with a message, in this case any ftp failures.
Here I put in an incorrect login.
jnpr@router# run op wrn
fetch: ftp://username:*@x.x.x.x/router-config.gz: Not logged in
Here I disconnected interface from the network
jnpr@router# run op wrn
fetch: ftp://username:*@x.x.x.x/router-config.gz: No route to host
A false condition means there is no content reply from the executed variable. Which means FTP succeeded. Therefore I created test to reflect that:
jnpr@router# run op wrn
FTP'd Successfully