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
(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/





 

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

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