OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] xsl:if to find the existence of an element

[ Lists Home | Date Index | Thread Index ]

Hi Ravi,

Questions about XSLT should really go to 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:


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">
    <element name="TransactionIdentifier" type="ebsidicString"
             totalDigits="4" value="TX03"/>
    <element name="BusinessDayDate" type="date" totalDigits="8"
    <element name="TaxOutOfCountryFlag" type="ebsidicString"
             totalDigits="1" value="N">
      <xsl:if test="TaxOutOfCountryFlag">
        <xsl:attribute name="value">Y</xsl:attribute>



Jeni Tennison


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS