Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

XSL Style Sheet Question

Posted on 2009-07-07
7
Medium Priority
?
919 Views
Last Modified: 2013-11-18
Hello,

I am trying to extract data from the XML via an XSL seems I am not able to extract the data though looked at the syntax documentation but not able to find anything wrong with my XSL which is also given below the sample XML.

Your help would be appreciated.

Thanks,
Alok

Sample XML

<?xml version="1.0" encoding="UTF-8"?>
<SWBML xmlns="http://www.fpml.org/2005/FpML-4-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4-2" xsi:schemaLocation="http://www.fpml.org/2005/FpML-4-2 swbml-ird-main-4-2.xsd">
      <swbHeader>
            <swbBrokerTradeId>ALOK4_1108299</swbBrokerTradeId>
            <swbBrokerTradeVersionId>15</swbBrokerTradeVersionId>
            <swbTradeSource>Voice</swbTradeSource>
            <swbRecipient id="_recip_1_">
                  <partyReference href="partyA"/>
            </swbRecipient>
            <swbRecipient id="_recip_2_">
                  <partyReference href="partyB"/>
            </swbRecipient>
      </swbHeader>
      <swbStructuredTradeDetails>
            <swbProductType>Single Currency Basis Swap</swbProductType>
            <FpML xmlns="http://www.fpml.org/2005/FpML-4-2" version="4-2" xsi:type="DataDocument">
                  <trade id="ALOK4_1108299">
                        <tradeHeader>
                              <partyTradeIdentifier>
                                    <partyReference href="partyA"/>
                                    <tradeId tradeIdScheme="http://www.swapswire.com/spec/2001/trade-id-1-0">ALOK4_1108299</tradeId>
                              </partyTradeIdentifier>
                              <partyTradeIdentifier>
                                    <partyReference href="partyB"/>
                                    <tradeId tradeIdScheme="http://www.swapswire.com/spec/2001/trade-id-1-0">ALOK4_1108299</tradeId>
                              </partyTradeIdentifier>
                              <tradeDate>2009-07-07</tradeDate>
                        </tradeHeader>
                        <swap>
                              <swapStream id="floatingLeg">
                                    <payerPartyReference href="partyA"/>
                                    <receiverPartyReference href="partyB"/>
                                    <calculationPeriodDates id="floatingLegCalcPeriodDates">
                                          <effectiveDate>
                                                <unadjustedDate>2009-07-09</unadjustedDate>
                                                <dateAdjustments>
                                                      <businessDayConvention>NONE</businessDayConvention>
                                                </dateAdjustments>
                                          </effectiveDate>
                                          <terminationDate>
                                                <unadjustedDate>2010-07-09</unadjustedDate>
                                                <dateAdjustments>
                                                      <businessDayConvention>MODFOLLOWING</businessDayConvention>
                                                      <businessCenters>
                                                            <businessCenter>GBLO</businessCenter>
                                                            <businessCenter>USNY</businessCenter>
                                                      </businessCenters>
                                                </dateAdjustments>
                                          </terminationDate>
                                          <calculationPeriodDatesAdjustments>
                                                <businessDayConvention>MODFOLLOWING</businessDayConvention>
                                                <businessCenters>
                                                      <businessCenter>GBLO</businessCenter>
                                                      <businessCenter>USNY</businessCenter>
                                                </businessCenters>
                                          </calculationPeriodDatesAdjustments>
                                          <calculationPeriodFrequency>
                                                <periodMultiplier>1</periodMultiplier>
                                                <period>M</period>
                                                <rollConvention>9</rollConvention>
                                          </calculationPeriodFrequency>
                                    </calculationPeriodDates>
                                    <paymentDates>
                                          <calculationPeriodDatesReference href="floatingLegCalcPeriodDates"/>
                                          <paymentFrequency>
                                                <periodMultiplier>1</periodMultiplier>
                                                <period>M</period>
                                          </paymentFrequency>
                                          <payRelativeTo>CalculationPeriodEndDate</payRelativeTo>
                                          <paymentDatesAdjustments>
                                                <businessDayConvention>MODFOLLOWING</businessDayConvention>
                                                <businessCenters>
                                                      <businessCenter>GBLO</businessCenter>
                                                      <businessCenter>USNY</businessCenter>
                                                </businessCenters>
                                          </paymentDatesAdjustments>
                                    </paymentDates>
                                    <resetDates id="floatingLegResetDates">
                                          <calculationPeriodDatesReference href="floatingLegCalcPeriodDates"/>
                                          <resetRelativeTo>CalculationPeriodStartDate</resetRelativeTo>
                                          <fixingDates>
                                                <periodMultiplier>-2</periodMultiplier>
                                                <period>D</period>
                                                <dayType>Business</dayType>
                                                <businessDayConvention>NONE</businessDayConvention>
                                                <businessCenters>
                                                      <businessCenter>GBLO</businessCenter>
                                                </businessCenters>
                                                <dateRelativeTo href="floatingLegResetDates"/>
                                          </fixingDates>
                                          <resetFrequency>
                                                <periodMultiplier>1</periodMultiplier>
                                                <period>M</period>
                                          </resetFrequency>
                                          <resetDatesAdjustments>
                                                <businessDayConvention>MODFOLLOWING</businessDayConvention>
                                                <businessCenters>
                                                      <businessCenter>GBLO</businessCenter>
                                                      <businessCenter>USNY</businessCenter>
                                                </businessCenters>
                                          </resetDatesAdjustments>
                                    </resetDates>
                                    <calculationPeriodAmount>
                                          <calculation>
                                                <notionalSchedule>
                                                      <notionalStepSchedule>
                                                            <initialValue>50000000</initialValue>
                                                            <currency>USD</currency>
                                                      </notionalStepSchedule>
                                                </notionalSchedule>
                                                <floatingRateCalculation>
                                                      <floatingRateIndex>USD-LIBOR-BBA</floatingRateIndex>
                                                      <indexTenor>
                                                            <periodMultiplier>1</periodMultiplier>
                                                            <period>M</period>
                                                      </indexTenor>
                                                      <spreadSchedule>
                                                            <initialValue>0.0007</initialValue>
                                                      </spreadSchedule>
                                                      <initialRate>0.06</initialRate>
                                                </floatingRateCalculation>
                                                <dayCountFraction>ACT/360</dayCountFraction>
                                          </calculation>
                                    </calculationPeriodAmount>
                              </swapStream>
                              <swapStream id="floatingLeg2">
                                    <payerPartyReference href="partyB"/>
                                    <receiverPartyReference href="partyA"/>
                                    <calculationPeriodDates id="floatingLeg2CalcPeriodDates">
                                          <effectiveDate>
                                                <unadjustedDate>2009-07-09</unadjustedDate>
                                                <dateAdjustments>
                                                      <businessDayConvention>NONE</businessDayConvention>
                                                </dateAdjustments>
                                          </effectiveDate>
                                          <terminationDate>
                                                <unadjustedDate>2010-07-09</unadjustedDate>
                                                <dateAdjustments>
                                                      <businessDayConvention>MODFOLLOWING</businessDayConvention>
                                                      <businessCenters>
                                                            <businessCenter>GBLO</businessCenter>
                                                            <businessCenter>USNY</businessCenter>
                                                      </businessCenters>
                                                </dateAdjustments>
                                          </terminationDate>
                                          <calculationPeriodDatesAdjustments>
                                                <businessDayConvention>MODFOLLOWING</businessDayConvention>
                                                <businessCenters>
                                                      <businessCenter>GBLO</businessCenter>
                                                      <businessCenter>USNY</businessCenter>
                                                </businessCenters>
                                          </calculationPeriodDatesAdjustments>
                                          <calculationPeriodFrequency>
                                                <periodMultiplier>3</periodMultiplier>
                                                <period>M</period>
                                                <rollConvention>9</rollConvention>
                                          </calculationPeriodFrequency>
                                    </calculationPeriodDates>
                                    <paymentDates>
                                          <calculationPeriodDatesReference href="floatingLeg2CalcPeriodDates"/>
                                          <paymentFrequency>
                                                <periodMultiplier>3</periodMultiplier>
                                                <period>M</period>
                                          </paymentFrequency>
                                          <payRelativeTo>CalculationPeriodEndDate</payRelativeTo>
                                          <paymentDatesAdjustments>
                                                <businessDayConvention>MODFOLLOWING</businessDayConvention>
                                                <businessCenters>
                                                      <businessCenter>GBLO</businessCenter>
                                                      <businessCenter>USNY</businessCenter>
                                                </businessCenters>
                                          </paymentDatesAdjustments>
                                    </paymentDates>
                                    <resetDates id="floatingLeg2ResetDates">
                                          <calculationPeriodDatesReference href="floatingLeg2CalcPeriodDates"/>
                                          <resetRelativeTo>CalculationPeriodStartDate</resetRelativeTo>
                                          <fixingDates>
                                                <periodMultiplier>-2</periodMultiplier>
                                                <period>D</period>
                                                <dayType>Business</dayType>
                                                <businessDayConvention>NONE</businessDayConvention>
                                                <businessCenters>
                                                      <businessCenter>GBLO</businessCenter>
                                                </businessCenters>
                                                <dateRelativeTo href="floatingLeg2ResetDates"/>
                                          </fixingDates>
                                          <resetFrequency>
                                                <periodMultiplier>3</periodMultiplier>
                                                <period>M</period>
                                          </resetFrequency>
                                          <resetDatesAdjustments>
                                                <businessDayConvention>MODFOLLOWING</businessDayConvention>
                                                <businessCenters>
                                                      <businessCenter>GBLO</businessCenter>
                                                      <businessCenter>USNY</businessCenter>
                                                </businessCenters>
                                          </resetDatesAdjustments>
                                    </resetDates>
                                    <calculationPeriodAmount>
                                          <calculation>
                                                <notionalSchedule>
                                                      <notionalStepSchedule>
                                                            <initialValue>50000000</initialValue>
                                                            <currency>USD</currency>
                                                      </notionalStepSchedule>
                                                </notionalSchedule>
                                                <floatingRateCalculation>
                                                      <floatingRateIndex>USD-LIBOR-BBA</floatingRateIndex>
                                                      <indexTenor>
                                                            <periodMultiplier>3</periodMultiplier>
                                                            <period>M</period>
                                                      </indexTenor>
                                                      <initialRate>0.06</initialRate>
                                                </floatingRateCalculation>
                                                <dayCountFraction>ACT/360</dayCountFraction>
                                          </calculation>
                                    </calculationPeriodAmount>
                              </swapStream>
                        </swap>
                        <otherPartyPayment>
                              <payerPartyReference href="partyA"/>
                              <receiverPartyReference href="broker1"/>
                              <paymentAmount>
                                    <currency>USD</currency>
                                    <amount>0.0</amount>
                              </paymentAmount>
                        </otherPartyPayment>
                        <otherPartyPayment>
                              <payerPartyReference href="partyB"/>
                              <receiverPartyReference href="broker1"/>
                              <paymentAmount>
                                    <currency>USD</currency>
                                    <amount>0.0</amount>
                              </paymentAmount>
                        </otherPartyPayment>
                        <documentation>
                              <masterAgreement>
                                    <masterAgreementType masterAgreementTypeScheme="http://www.swapswire.com/spec/2001/master-agreement-type-1-0">ISDA</masterAgreementType>
                              </masterAgreement>
                              <contractualDefinitions>ISDA2006</contractualDefinitions>
                        </documentation>
                  </trade>
                  <party id="partyA">
                        <partyId>BB1TULLLE1</partyId>
                  </party>
                  <party id="partyB">
                        <partyId>BB2TULLLE1</partyId>
                  </party>
                  <party id="broker1">
                        <partyId>TULL_NY</partyId>
                  </party>
            </FpML>
            <swbExtendedTradeDetails>
                  <swbProductTerm>
                        <periodMultiplier>1</periodMultiplier>
                        <period>Y</period>
                  </swbProductTerm>
                  <swbMessageText>Brokerage to be invoiced directly with Tullett.</swbMessageText>
            </swbExtendedTradeDetails>
      </swbStructuredTradeDetails>
</SWBML>

Sample XSL

<!--<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">-->
            <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fpml="http://www.fpml.org/2005/FpML-4-2"
xmlns:fo="http://www.w3.org/1999/XSL/Format" >
    <xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/>

    <xsl:template match="/">
        <xsl:text disable-output-escaping="yes">TradeVersion: </xsl:text>
        <xsl:value-of select="SWBML/swbHeader/swbBrokerTradeVersionId"/>
        <xsl:text>&#xD;</xsl:text>
          <!--<xsl:text disable-output-escaping="yes">swbRecipient Called. </xsl:text>-->
        <xsl:apply-templates select="/SWBML/swbHeader/swbRecipient"/>
          <!--<xsl:text disable-output-escaping="yes">Party Called. </xsl:text>-->
          <xsl:apply-templates select="/SWBML/swbStructuredTradeDetails/FpML/party"/>
    </xsl:template>

    <xsl:template match="swbRecipient">
        <xsl:param name="href" select="./partyReference/@href"/>
        <xsl:param name="dealType" select="/SWBML/swbStructuredTradeDetails/swbProductType"/>
        <xsl:param name="definingleg" select="'fixedLeg'"/>
        <xsl:param name="definingpath" select="/SWBML/swbStructuredTradeDetails/FpML/trade/swap/swapStream"/>
          <!--<xsl:text disable-output-escaping="yes">swbRecipient In. </xsl:text>-->
        <xsl:choose>
              <xsl:when test="$dealType = 'Single Currency Basis Swap'">
                  <xsl:call-template name="getRecipientInformation">
                      <xsl:with-param name="href" select="$href"/>
                      <xsl:with-param name="payer" select="/SWBML/swbStructuredTradeDetails/FpML/trade/swap/swapStreams/swapStream[@id='floatingLeg']/payerPartyReference"/>
                      <xsl:with-param name="receiver" select="/SWBML/swbStructuredTradeDetails/FpML/trade/swap/swapStreams/swapStream[@id='floatingLeg']/receiverPartyReference"/>
                  </xsl:call-template>
              </xsl:when>

            <xsl:otherwise>
                <xsl:call-template name="getRecipientInformation">
                    <xsl:with-param name="href" select="$href"/>
                    <xsl:with-param name="payer" select="/SWBML/swbStructuredTradeDetails/FpML/trade/swap/swapStream[@id=$definingleg]/payerPartyReference"/>
                    <xsl:with-param name="receiver" select="/SWBML/swbStructuredTradeDetails/FpML/trade/swap/swapStream[@id=$definingleg]/receiverPartyReference"/>
                </xsl:call-template>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template name="getRecipientInformation">
        <xsl:param name="href"/>
        <xsl:param name="payer"/>
        <xsl:param name="receiver"/>
        <xsl:choose>
            <xsl:when test="$payer/@href = $href">
                <xsl:text disable-output-escaping="yes">PayerRecipTag: </xsl:text>
                <xsl:value-of select="@id"/>
            </xsl:when>
            <xsl:when test="$receiver/@href = $href">
                <xsl:text disable-output-escaping="yes">ReceiverRecipTag: </xsl:text>
                <xsl:value-of select="@id"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:text disable-output-escaping="yes"></xsl:text>
                <xsl:value-of select="@id"/>
            </xsl:otherwise>
        </xsl:choose>
        <xsl:text>&#xD;</xsl:text>
    </xsl:template>

    <xsl:template match="party">
        <xsl:param name="href" select="./@id"/>
        <xsl:param name="dealType" select="/SWBML/swbStructuredTradeDetails/swbProductType"/>
        <xsl:param name="definingleg" select="'floatingLeg'"/>
        <xsl:param name="definingpath" select="/SWBML/swbStructuredTradeDetails/FpML/trade/swap/swapStream"/>
        <xsl:choose>
            <!--<xsl:when test="$dealType = 'Single Currency Basis Swap'">-->
                <!--<xsl:call-template name="getFraSwiftInformation">-->
                    <!--<xsl:with-param name="href" select="$href"/>-->
                <!--</xsl:call-template>-->
            <!--</xsl:when>-->

            <xsl:when test="$dealType = 'CDS'">
                <xsl:call-template name="getCDSSwiftInformation">
                    <xsl:with-param name="href" select="$href"/>
                </xsl:call-template>
            </xsl:when>

            <xsl:otherwise>
                <xsl:choose>
                    <xsl:when test="$definingpath[@id=$definingleg]/payerPartyReference/@href = concat('#', $href)">
                        <xsl:call-template name="swiftStrip">
                            <xsl:with-param name="swiftId" select="./partyId/text()"/>
                            <xsl:with-param name="payrec">
                                <xsl:text disable-output-escaping="yes">PayerSwiftcode: </xsl:text>
                            </xsl:with-param>
                            <xsl:with-param name="sspSide">
                                <xsl:text disable-output-escaping="yes">P</xsl:text>
                            </xsl:with-param>
                        </xsl:call-template>
                    </xsl:when>
                    <xsl:when test="$definingpath[@id=$definingleg]/receiverPartyReference/@href = concat('#', $href)">
                        <xsl:call-template name="swiftStrip">
                            <xsl:with-param name="swiftId" select="./partyId/text()"/>
                            <xsl:with-param name="payrec">
                                <xsl:text disable-output-escaping="yes">ReceiverSwiftcode: </xsl:text>
                            </xsl:with-param>
                            <xsl:with-param name="sspSide">
                                <xsl:text disable-output-escaping="yes">R</xsl:text>
                            </xsl:with-param>
                        </xsl:call-template>
                    </xsl:when>
                </xsl:choose>
                <xsl:text>&#xD;</xsl:text>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template name="getFraSwiftInformation">
        <xsl:param name="href"/>
        <xsl:param name="definingpath" select="/SWBML/swbStructuredTradeDetails/FpML/trade/fra"/>
        <xsl:choose>
            <xsl:when test="$definingpath/buyerPartyReference/@href = concat('#', $href)">
                <xsl:call-template name="swiftStrip">
                    <xsl:with-param name="swiftId" select="./partyId/text()"/>
                    <xsl:with-param name="payrec">
                        <xsl:text disable-output-escaping="yes">PayerSwiftcode: </xsl:text>
                    </xsl:with-param>
                    <xsl:with-param name="sspSide">
                        <xsl:text disable-output-escaping="yes">P</xsl:text>
                    </xsl:with-param>
                </xsl:call-template>
            </xsl:when>
            <xsl:when test="$definingpath/sellerPartyReference/@href = concat('#', $href)">
                <xsl:call-template name="swiftStrip">
                    <xsl:with-param name="swiftId" select="./partyId/text()"/>
                    <xsl:with-param name="payrec">
                        <xsl:text disable-output-escaping="yes">ReceiverSwiftcode: </xsl:text>
                    </xsl:with-param>
                    <xsl:with-param name="sspSide">
                        <xsl:text disable-output-escaping="yes">R</xsl:text>
                    </xsl:with-param>
                </xsl:call-template>
            </xsl:when>
        </xsl:choose>
        <xsl:text>&#xD;</xsl:text>
    </xsl:template>

    <xsl:template name="getCDSSwiftInformation">
        <xsl:param name="href"/>
        <xsl:param name="definingpath" select="/SWBML/swbStructuredTradeDetails/FpML/trade/creditDefaultSwap/generalTerms"/>
        <xsl:choose>
            <xsl:when test="$definingpath/buyerPartyReference/@href = $href">
                <xsl:call-template name="swiftStrip">
                    <xsl:with-param name="swiftId" select="./partyId/text()"/>
                    <xsl:with-param name="payrec">
                        <xsl:text disable-output-escaping="yes">PayerSwiftcode: </xsl:text>
                    </xsl:with-param>
                    <xsl:with-param name="sspSide">
                        <xsl:text disable-output-escaping="yes">P</xsl:text>
                    </xsl:with-param>
                </xsl:call-template>
            </xsl:when>
            <xsl:when test="$definingpath/sellerPartyReference/@href = $href">
                <xsl:call-template name="swiftStrip">
                    <xsl:with-param name="swiftId" select="./partyId/text()"/>
                    <xsl:with-param name="payrec">
                        <xsl:text disable-output-escaping="yes">ReceiverSwiftcode: </xsl:text>
                    </xsl:with-param>
                    <xsl:with-param name="sspSide">
                        <xsl:text disable-output-escaping="yes">R</xsl:text>
                    </xsl:with-param>
                </xsl:call-template>
            </xsl:when>
        </xsl:choose>
        <xsl:text>&#xD;</xsl:text>
    </xsl:template>

    <xsl:template name="swiftStrip">
        <xsl:param name="swiftId"/>
        <xsl:param name="payrec"/>
        <xsl:param name="sspSide"/>
        <xsl:text disable-output-escaping="yes"></xsl:text>
        <xsl:value-of select="$payrec"/>
        <xsl:choose>

            <xsl:when test="string-length(substring-before($swiftId, 'XXX_SSP'))  > 0">
                <xsl:value-of select="substring-before($swiftId, 'XXX_SSP')"/>
                <xsl:text>&#xD;</xsl:text>

                <xsl:text disable-output-escaping="yes">SspSide: </xsl:text>
                <xsl:value-of select="$sspSide"/>
                <xsl:text>&#xD;</xsl:text>

            </xsl:when>

            <xsl:when test="string-length(substring-before($swiftId, '_SSP'))  > 0">
                <xsl:value-of select="substring-before($swiftId, '_SSP')"/>
                <xsl:text>&#xD;</xsl:text>

                <xsl:text disable-output-escaping="yes">SspSide: </xsl:text>
                <xsl:value-of select="$sspSide"/>
                <xsl:text>&#xD;</xsl:text>

            </xsl:when>

            <xsl:otherwise>
                <xsl:value-of select="$swiftId"/>
            </xsl:otherwise>

        </xsl:choose>
    </xsl:template>

</xsl:stylesheet>
0
Comment
Question by:shukla1_alok
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 1

Expert Comment

by:cdall
ID: 24798621
Could you please specify what you are trying to extract excactly and maybe boil down the XML example to suggest a structure instead of giving this very long document?
0
 

Author Comment

by:shukla1_alok
ID: 24798751
Trying to Extract following node values from the XML

<swbBrokerTradeVersionId>15</swbBrokerTradeVersionId> from the following XML Section

<swbHeader>
      <swbBrokerTradeId>ALOK4_1108299</swbBrokerTradeId>
      <swbBrokerTradeVersionId>15</swbBrokerTradeVersionId>
      <swbTradeSource>Voice</swbTradeSource>
      <swbRecipient id="_recip_1_">
            <partyReference href="partyA"/>
      </swbRecipient>
      <swbRecipient id="_recip_2_">
            <partyReference href="partyB"/>
            </swbRecipient>
</swbHeader>

Trying to apply the following templates to extract the relevant data
Regarding the participants with the help below-mentioned particiapants.

<xsl:apply-templates select="/SWBML/swbHeader/swbRecipient"/>
<xsl:apply-templates select="/SWBML/swbStructuredTradeDetails/FpML/party"/>
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24798848
You have to realise that all elements are in a namespace
because of the xmlns attribute
<SWBML xmlns="http://www.fpml.org/2005/FpML-4-2"
So you will have to address the elements in this namespace
Yo can not do that by setting this namespace to the default namespace in your stylesheet, so you will need one with a prefix.
You did that right in your stylesheet header
xmlns:fpml="http://www.fpml.org/2005/FpML-4-2"
But this means that you need to prefix every element in every single XPath expression in your stylesheet

<xsl:apply-templates select="/fpml:SWBML/fpml:swbHeader/fpml:swbRecipient"/>
it is an ugly task, but there is no other way in XSLT1
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 60

Accepted Solution

by:
Geert Bormans earned 200 total points
ID: 24798902
I did part of your stylesheet just to show you what I mean

Working on the example gave me a direct positive result
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fpml="http://www.fpml.org/2005/FpML-4-2"
    xmlns:fo="http://www.w3.org/1999/XSL/Format" >
    <xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/>
    
    <xsl:template match="/">
        <xsl:text disable-output-escaping="yes">TradeVersion: </xsl:text>
        <xsl:value-of select="fpml:SWBML/fpml:swbHeader/fpml:swbBrokerTradeVersionId"/>
        <xsl:text>&#xD;</xsl:text>
        <!--<xsl:text disable-output-escaping="yes">swbRecipient Called. </xsl:text>-->
        <xsl:apply-templates select="/fpml:SWBML/fpml:swbHeader/fpml:swbRecipient"/>
        <!--<xsl:text disable-output-escaping="yes">Party Called. </xsl:text>-->
        <xsl:apply-templates select="/fpml:SWBML/fpml:swbStructuredTradeDetails/fpml:FpML/party"/>
    </xsl:template>
    
    <xsl:template match="fpml:swbRecipient">
        <xsl:param name="href" select="./fpml:partyReference/@href"/>
        <xsl:param name="dealType" select="/fpml:SWBML/fpml:swbStructuredTradeDetails/fpml:swbProductType"/>
        <xsl:param name="definingleg" select="'fixedLeg'"/>
        <xsl:param name="definingpath" select="/fpml:SWBML/fpml:swbStructuredTradeDetails/fpml:FpML/fpml:trade/fpml:swap/fpml:swapStream"/>
        <!--<xsl:text disable-output-escaping="yes">swbRecipient In. </xsl:text>-->
        <xsl:choose>
            <xsl:when test="$dealType = 'Single Currency Basis Swap'">
                <xsl:call-template name="getRecipientInformation">
                    <xsl:with-param name="href" select="$href"/>
                    <xsl:with-param name="payer" select="/fpml:SWBML/fpml:swbStructuredTradeDetails/fpml:FpML/fpml:trade/swap/fpml:swapStreams/fpml:swapStream[@id='floatingLeg']/fpml:payerPartyReference"/>
                    <xsl:with-param name="receiver" select="/fpml:SWBML/fpml:swbStructuredTradeDetails/fpml:FpML/fpml:trade/swap/fpml:swapStreams/fpml:swapStream[@id='floatingLeg']/fpml:receiverPartyReference"/>
                </xsl:call-template>
            </xsl:when>
            
            <xsl:otherwise>
                <xsl:call-template name="getRecipientInformation">
                    <xsl:with-param name="href" select="$href"/>
                    <xsl:with-param name="payer" select="/fpml:SWBML/fpml:swbStructuredTradeDetails/fpml:FpML/fpml:trade/fpml:swap/fpml:swapStream[@id=$definingleg]/fpml:payerPartyReference"/>
                    <xsl:with-param name="receiver" select="/fpml:SWBML/fpml:swbStructuredTradeDetails/fpml:FpML/fpml:trade/fpml:swap/fpml:swapStream[@id=$definingleg]/fpml:receiverPartyReference"/>
                </xsl:call-template>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
...

Open in new window

0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24798911
Note that in XSLT2, you can set the default namespace for all XPaths in the stylesheet, that takes away a lot of work from this example
0
 

Author Closing Comment

by:shukla1_alok
ID: 31600825
Perfecto,  I did the same thing for something else but simply didn't pay attention. But thanks for your help.
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24803321
welcome
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question