>>>>> "Sony" == Sony Antony <> writes:
Sony> We have a situation wherin we should translate the incoming XML based
Sony> on one schema to the outgoing XML that is based on another schema.
Sony> Since both input and output are both XML, XSLT was the natural
Sony> preference.
Sony> But there was a requirement that demanded a part of the generated XML
Sony> to be different depending on whether an element was present or not in
Sony> the incoming XML. Since we were only beginning with XML, we couldn t
Sony> find the Xpath xsl:if combination that will generate this logic. ( Can
Sony> somebody help me here, though that is not the main topic of this
Sony> posting )
XSLT's xsl:if is not like ifs in general programming languages, since it does
not come with xsl:else. Instead, you should use xsl:choose, like
<xsl:choose>
<xsl:when test="nameoftheelement">
<!-- do what you need with the element -->
</xsl:when>
<xsl

therwise>
<!-- element does not exist, do what is needed -->
</xsl

therwise>
</xsl:choose>
--
Arto V. Viitanen
University of Tampere, Department of Computer and Information Sciences
Tampere, Finland
http://www.cs.uta.fi/~av/