[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:if to find the existence of an element
Hi Ravi, Questions about XSLT should really go to XSL-List (http://www.mulberrytech.com/xsl/xsl-list). > Note: the "value" attribute of "TaxOutOfCountryFlag" is changing. You can test whether the current element has a TaxOutOfCountryFlag child element with the simple expression: TaxOutOfCountryFlag There are several ways that you could use this test to get what you want. Probably the simplest is something like: <xsl:template match="SendTaxRequest"> <SendTaxRequest> <element name="TransactionIdentifier" type="ebsidicString" totalDigits="4" value="TX03"/> <element name="BusinessDayDate" type="date" totalDigits="8" value="{BusinessDayDate}"/> <element name="TaxOutOfCountryFlag" type="ebsidicString" totalDigits="1" value="N"> <xsl:if test="TaxOutOfCountryFlag"> <xsl:attribute name="value">Y</xsl:attribute> </xsl:if> </element> </SendTaxRequest> </xsl:template> Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|