shukla1_alok
asked on
XSL Style Sheet Question
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_11 08299</swb BrokerTrad eId>
<swbBrokerTradeVersionId>1 5</swbBrok erTradeVer sionId>
<swbTradeSource>Voice</swb TradeSourc e>
<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_110 8299</trad eId>
</partyTradeIdentifier>
<partyTradeIdentifier>
<partyReference href="partyB"/>
<tradeId tradeIdScheme="http://www.swapswire.com/spec/2001/trade-id-1-0">ALOK4_110 8299</trad eId>
</partyTradeIdentifier>
<tradeDate>2009-07-07</tra deDate>
</tradeHeader>
<swap>
<swapStream id="floatingLeg">
<payerPartyReference href="partyA"/>
<receiverPartyReference href="partyB"/>
<calculationPeriodDates id="floatingLegCalcPeriodD ates">
<effectiveDate>
<unadjustedDate>2009-07-09 </unadjust edDate>
<dateAdjustments>
<businessDayConvention>NON E</busines sDayConven tion>
</dateAdjustments>
</effectiveDate>
<terminationDate>
<unadjustedDate>2010-07-09 </unadjust edDate>
<dateAdjustments>
<businessDayConvention>MOD FOLLOWING< /businessD ayConventi on>
<businessCenters>
<businessCenter>GBLO</busi nessCenter >
<businessCenter>USNY</busi nessCenter >
</businessCenters>
</dateAdjustments>
</terminationDate>
<calculationPeriodDatesAdj ustments>
<businessDayConvention>MOD FOLLOWING< /businessD ayConventi on>
<businessCenters>
<businessCenter>GBLO</busi nessCenter >
<businessCenter>USNY</busi nessCenter >
</businessCenters>
</calculationPeriodDatesAd justments>
<calculationPeriodFrequenc y>
<periodMultiplier>1</perio dMultiplie r>
<period>M</period>
<rollConvention>9</rollCon vention>
</calculationPeriodFrequen cy>
</calculationPeriodDates>
<paymentDates>
<calculationPeriodDatesRef erence href="floatingLegCalcPerio dDates"/>
<paymentFrequency>
<periodMultiplier>1</perio dMultiplie r>
<period>M</period>
</paymentFrequency>
<payRelativeTo>Calculation PeriodEndD ate</payRe lativeTo>
<paymentDatesAdjustments>
<businessDayConvention>MOD FOLLOWING< /businessD ayConventi on>
<businessCenters>
<businessCenter>GBLO</busi nessCenter >
<businessCenter>USNY</busi nessCenter >
</businessCenters>
</paymentDatesAdjustments>
</paymentDates>
<resetDates id="floatingLegResetDates" >
<calculationPeriodDatesRef erence href="floatingLegCalcPerio dDates"/>
<resetRelativeTo>Calculati onPeriodSt artDate</r esetRelati veTo>
<fixingDates>
<periodMultiplier>-2</peri odMultipli er>
<period>D</period>
<dayType>Business</dayType >
<businessDayConvention>NON E</busines sDayConven tion>
<businessCenters>
<businessCenter>GBLO</busi nessCenter >
</businessCenters>
<dateRelativeTo href="floatingLegResetDate s"/>
</fixingDates>
<resetFrequency>
<periodMultiplier>1</perio dMultiplie r>
<period>M</period>
</resetFrequency>
<resetDatesAdjustments>
<businessDayConvention>MOD FOLLOWING< /businessD ayConventi on>
<businessCenters>
<businessCenter>GBLO</busi nessCenter >
<businessCenter>USNY</busi nessCenter >
</businessCenters>
</resetDatesAdjustments>
</resetDates>
<calculationPeriodAmount>
<calculation>
<notionalSchedule>
<notionalStepSchedule>
<initialValue>50000000</in itialValue >
<currency>USD</currency>
</notionalStepSchedule>
</notionalSchedule>
<floatingRateCalculation>
<floatingRateIndex>USD-LIB OR-BBA</fl oatingRate Index>
<indexTenor>
<periodMultiplier>1</perio dMultiplie r>
<period>M</period>
</indexTenor>
<spreadSchedule>
<initialValue>0.0007</init ialValue>
</spreadSchedule>
<initialRate>0.06</initial Rate>
</floatingRateCalculation>
<dayCountFraction>ACT/360< /dayCountF raction>
</calculation>
</calculationPeriodAmount>
</swapStream>
<swapStream id="floatingLeg2">
<payerPartyReference href="partyB"/>
<receiverPartyReference href="partyA"/>
<calculationPeriodDates id="floatingLeg2CalcPeriod Dates">
<effectiveDate>
<unadjustedDate>2009-07-09 </unadjust edDate>
<dateAdjustments>
<businessDayConvention>NON E</busines sDayConven tion>
</dateAdjustments>
</effectiveDate>
<terminationDate>
<unadjustedDate>2010-07-09 </unadjust edDate>
<dateAdjustments>
<businessDayConvention>MOD FOLLOWING< /businessD ayConventi on>
<businessCenters>
<businessCenter>GBLO</busi nessCenter >
<businessCenter>USNY</busi nessCenter >
</businessCenters>
</dateAdjustments>
</terminationDate>
<calculationPeriodDatesAdj ustments>
<businessDayConvention>MOD FOLLOWING< /businessD ayConventi on>
<businessCenters>
<businessCenter>GBLO</busi nessCenter >
<businessCenter>USNY</busi nessCenter >
</businessCenters>
</calculationPeriodDatesAd justments>
<calculationPeriodFrequenc y>
<periodMultiplier>3</perio dMultiplie r>
<period>M</period>
<rollConvention>9</rollCon vention>
</calculationPeriodFrequen cy>
</calculationPeriodDates>
<paymentDates>
<calculationPeriodDatesRef erence href="floatingLeg2CalcPeri odDates"/>
<paymentFrequency>
<periodMultiplier>3</perio dMultiplie r>
<period>M</period>
</paymentFrequency>
<payRelativeTo>Calculation PeriodEndD ate</payRe lativeTo>
<paymentDatesAdjustments>
<businessDayConvention>MOD FOLLOWING< /businessD ayConventi on>
<businessCenters>
<businessCenter>GBLO</busi nessCenter >
<businessCenter>USNY</busi nessCenter >
</businessCenters>
</paymentDatesAdjustments>
</paymentDates>
<resetDates id="floatingLeg2ResetDates ">
<calculationPeriodDatesRef erence href="floatingLeg2CalcPeri odDates"/>
<resetRelativeTo>Calculati onPeriodSt artDate</r esetRelati veTo>
<fixingDates>
<periodMultiplier>-2</peri odMultipli er>
<period>D</period>
<dayType>Business</dayType >
<businessDayConvention>NON E</busines sDayConven tion>
<businessCenters>
<businessCenter>GBLO</busi nessCenter >
</businessCenters>
<dateRelativeTo href="floatingLeg2ResetDat es"/>
</fixingDates>
<resetFrequency>
<periodMultiplier>3</perio dMultiplie r>
<period>M</period>
</resetFrequency>
<resetDatesAdjustments>
<businessDayConvention>MOD FOLLOWING< /businessD ayConventi on>
<businessCenters>
<businessCenter>GBLO</busi nessCenter >
<businessCenter>USNY</busi nessCenter >
</businessCenters>
</resetDatesAdjustments>
</resetDates>
<calculationPeriodAmount>
<calculation>
<notionalSchedule>
<notionalStepSchedule>
<initialValue>50000000</in itialValue >
<currency>USD</currency>
</notionalStepSchedule>
</notionalSchedule>
<floatingRateCalculation>
<floatingRateIndex>USD-LIB OR-BBA</fl oatingRate Index>
<indexTenor>
<periodMultiplier>3</perio dMultiplie r>
<period>M</period>
</indexTenor>
<initialRate>0.06</initial Rate>
</floatingRateCalculation>
<dayCountFraction>ACT/360< /dayCountF raction>
</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</m asterAgree mentType>
</masterAgreement>
<contractualDefinitions>IS DA2006</co ntractualD efinitions >
</documentation>
</trade>
<party id="partyA">
<partyId>BB1TULLLE1</party Id>
</party>
<party id="partyB">
<partyId>BB2TULLLE1</party Id>
</party>
<party id="broker1">
<partyId>TULL_NY</partyId>
</party>
</FpML>
<swbExtendedTradeDetails>
<swbProductTerm>
<periodMultiplier>1</perio dMultiplie r>
<period>Y</period>
</swbProductTerm>
<swbMessageText>Brokerage to be invoiced directly with Tullett.</swbMessageText>
</swbExtendedTradeDetails>
</swbStructuredTradeDetail s>
</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="y es">TradeV ersion: </xsl:text>
<xsl:value-of select="SWBML/swbHeader/sw bBrokerTra deVersionI d"/>
<xsl:text>
</xsl:text>
<!--<xsl:text disable-output-escaping="y es">swbRec ipient Called. </xsl:text>-->
<xsl:apply-templates select="/SWBML/swbHeader/s wbRecipien t"/>
<!--<xsl:text disable-output-escaping="y es">Party Called. </xsl:text>-->
<xsl:apply-templates select="/SWBML/swbStructur edTradeDet ails/FpML/ party"/>
</xsl:template>
<xsl:template match="swbRecipient">
<xsl:param name="href" select="./partyReference/@ href"/>
<xsl:param name="dealType" select="/SWBML/swbStructur edTradeDet ails/swbPr oductType" />
<xsl:param name="definingleg" select="'fixedLeg'"/>
<xsl:param name="definingpath" select="/SWBML/swbStructur edTradeDet ails/FpML/ trade/swap /swapStrea m"/>
<!--<xsl:text disable-output-escaping="y es">swbRec ipient In. </xsl:text>-->
<xsl:choose>
<xsl:when test="$dealType = 'Single Currency Basis Swap'">
<xsl:call-template name="getRecipientInformat ion">
<xsl:with-param name="href" select="$href"/>
<xsl:with-param name="payer" select="/SWBML/swbStructur edTradeDet ails/FpML/ trade/swap /swapStrea ms/swapStr eam[@id='f loatingLeg ']/payerPa rtyReferen ce"/>
<xsl:with-param name="receiver" select="/SWBML/swbStructur edTradeDet ails/FpML/ trade/swap /swapStrea ms/swapStr eam[@id='f loatingLeg ']/receive rPartyRefe rence"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="getRecipientInformat ion">
<xsl:with-param name="href" select="$href"/>
<xsl:with-param name="payer" select="/SWBML/swbStructur edTradeDet ails/FpML/ trade/swap /swapStrea m[@id=$def iningleg]/ payerParty Reference" />
<xsl:with-param name="receiver" select="/SWBML/swbStructur edTradeDet ails/FpML/ trade/swap /swapStrea m[@id=$def iningleg]/ receiverPa rtyReferen ce"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="getRecipientInformat ion">
<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="y es">PayerR ecipTag: </xsl:text>
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:when test="$receiver/@href = $href">
<xsl:text disable-output-escaping="y es">Receiv erRecipTag : </xsl:text>
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:text disable-output-escaping="y es"></xsl: text>
<xsl:value-of select="@id"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="party">
<xsl:param name="href" select="./@id"/>
<xsl:param name="dealType" select="/SWBML/swbStructur edTradeDet ails/swbPr oductType" />
<xsl:param name="definingleg" select="'floatingLeg'"/>
<xsl:param name="definingpath" select="/SWBML/swbStructur edTradeDet ails/FpML/ trade/swap /swapStrea m"/>
<xsl:choose>
<!--<xsl:when test="$dealType = 'Single Currency Basis Swap'">-->
<!--<xsl:call-template name="getFraSwiftInformati on">-->
<!--<xsl:with-param name="href" select="$href"/>-->
<!--</xsl:call-template>-- >
<!--</xsl:when>-->
<xsl:when test="$dealType = 'CDS'">
<xsl:call-template name="getCDSSwiftInformati on">
<xsl:with-param name="href" select="$href"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$definingpath[@id=$d efiningleg ]/payerPar tyReferenc e/@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="y es">PayerS wiftcode: </xsl:text>
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y es">P</xsl :text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$definingpath[@id=$d efiningleg ]/receiver PartyRefer ence/@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="y es">Receiv erSwiftcod e: </xsl:text>
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y es">R</xsl :text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
<xsl:text>
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="getFraSwiftInformati on">
<xsl:param name="href"/>
<xsl:param name="definingpath" select="/SWBML/swbStructur edTradeDet ails/FpML/ trade/fra" />
<xsl:choose>
<xsl:when test="$definingpath/buyerP artyRefere nce/@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="y es">PayerS wiftcode: </xsl:text>
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y es">P</xsl :text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$definingpath/seller PartyRefer ence/@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="y es">Receiv erSwiftcod e: </xsl:text>
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y es">R</xsl :text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template name="getCDSSwiftInformati on">
<xsl:param name="href"/>
<xsl:param name="definingpath" select="/SWBML/swbStructur edTradeDet ails/FpML/ trade/cred itDefaultS wap/genera lTerms"/>
<xsl:choose>
<xsl:when test="$definingpath/buyerP artyRefere nce/@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="y es">PayerS wiftcode: </xsl:text>
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y es">P</xsl :text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$definingpath/seller PartyRefer ence/@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="y es">Receiv erSwiftcod e: </xsl:text>
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y es">R</xsl :text>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
<xsl:text>
</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="y es"></xsl: text>
<xsl:value-of select="$payrec"/>
<xsl:choose>
<xsl:when test="string-length(substr ing-before ($swiftId, 'XXX_SSP')) > 0">
<xsl:value-of select="substring-before($ swiftId, 'XXX_SSP')"/>
<xsl:text>
</xsl:text>
<xsl:text disable-output-escaping="y es">SspSid e: </xsl:text>
<xsl:value-of select="$sspSide"/>
<xsl:text>
</xsl:text>
</xsl:when>
<xsl:when test="string-length(substr ing-before ($swiftId, '_SSP')) > 0">
<xsl:value-of select="substring-before($ swiftId, '_SSP')"/>
<xsl:text>
</xsl:text>
<xsl:text disable-output-escaping="y es">SspSid e: </xsl:text>
<xsl:value-of select="$sspSide"/>
<xsl:text>
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$swiftId"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
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_11
<swbBrokerTradeVersionId>1
<swbTradeSource>Voice</swb
<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_110
</partyTradeIdentifier>
<partyTradeIdentifier>
<partyReference href="partyB"/>
<tradeId tradeIdScheme="http://www.swapswire.com/spec/2001/trade-id-1-0">ALOK4_110
</partyTradeIdentifier>
<tradeDate>2009-07-07</tra
</tradeHeader>
<swap>
<swapStream id="floatingLeg">
<payerPartyReference href="partyA"/>
<receiverPartyReference href="partyB"/>
<calculationPeriodDates id="floatingLegCalcPeriodD
<effectiveDate>
<unadjustedDate>2009-07-09
<dateAdjustments>
<businessDayConvention>NON
</dateAdjustments>
</effectiveDate>
<terminationDate>
<unadjustedDate>2010-07-09
<dateAdjustments>
<businessDayConvention>MOD
<businessCenters>
<businessCenter>GBLO</busi
<businessCenter>USNY</busi
</businessCenters>
</dateAdjustments>
</terminationDate>
<calculationPeriodDatesAdj
<businessDayConvention>MOD
<businessCenters>
<businessCenter>GBLO</busi
<businessCenter>USNY</busi
</businessCenters>
</calculationPeriodDatesAd
<calculationPeriodFrequenc
<periodMultiplier>1</perio
<period>M</period>
<rollConvention>9</rollCon
</calculationPeriodFrequen
</calculationPeriodDates>
<paymentDates>
<calculationPeriodDatesRef
<paymentFrequency>
<periodMultiplier>1</perio
<period>M</period>
</paymentFrequency>
<payRelativeTo>Calculation
<paymentDatesAdjustments>
<businessDayConvention>MOD
<businessCenters>
<businessCenter>GBLO</busi
<businessCenter>USNY</busi
</businessCenters>
</paymentDatesAdjustments>
</paymentDates>
<resetDates id="floatingLegResetDates"
<calculationPeriodDatesRef
<resetRelativeTo>Calculati
<fixingDates>
<periodMultiplier>-2</peri
<period>D</period>
<dayType>Business</dayType
<businessDayConvention>NON
<businessCenters>
<businessCenter>GBLO</busi
</businessCenters>
<dateRelativeTo href="floatingLegResetDate
</fixingDates>
<resetFrequency>
<periodMultiplier>1</perio
<period>M</period>
</resetFrequency>
<resetDatesAdjustments>
<businessDayConvention>MOD
<businessCenters>
<businessCenter>GBLO</busi
<businessCenter>USNY</busi
</businessCenters>
</resetDatesAdjustments>
</resetDates>
<calculationPeriodAmount>
<calculation>
<notionalSchedule>
<notionalStepSchedule>
<initialValue>50000000</in
<currency>USD</currency>
</notionalStepSchedule>
</notionalSchedule>
<floatingRateCalculation>
<floatingRateIndex>USD-LIB
<indexTenor>
<periodMultiplier>1</perio
<period>M</period>
</indexTenor>
<spreadSchedule>
<initialValue>0.0007</init
</spreadSchedule>
<initialRate>0.06</initial
</floatingRateCalculation>
<dayCountFraction>ACT/360<
</calculation>
</calculationPeriodAmount>
</swapStream>
<swapStream id="floatingLeg2">
<payerPartyReference href="partyB"/>
<receiverPartyReference href="partyA"/>
<calculationPeriodDates id="floatingLeg2CalcPeriod
<effectiveDate>
<unadjustedDate>2009-07-09
<dateAdjustments>
<businessDayConvention>NON
</dateAdjustments>
</effectiveDate>
<terminationDate>
<unadjustedDate>2010-07-09
<dateAdjustments>
<businessDayConvention>MOD
<businessCenters>
<businessCenter>GBLO</busi
<businessCenter>USNY</busi
</businessCenters>
</dateAdjustments>
</terminationDate>
<calculationPeriodDatesAdj
<businessDayConvention>MOD
<businessCenters>
<businessCenter>GBLO</busi
<businessCenter>USNY</busi
</businessCenters>
</calculationPeriodDatesAd
<calculationPeriodFrequenc
<periodMultiplier>3</perio
<period>M</period>
<rollConvention>9</rollCon
</calculationPeriodFrequen
</calculationPeriodDates>
<paymentDates>
<calculationPeriodDatesRef
<paymentFrequency>
<periodMultiplier>3</perio
<period>M</period>
</paymentFrequency>
<payRelativeTo>Calculation
<paymentDatesAdjustments>
<businessDayConvention>MOD
<businessCenters>
<businessCenter>GBLO</busi
<businessCenter>USNY</busi
</businessCenters>
</paymentDatesAdjustments>
</paymentDates>
<resetDates id="floatingLeg2ResetDates
<calculationPeriodDatesRef
<resetRelativeTo>Calculati
<fixingDates>
<periodMultiplier>-2</peri
<period>D</period>
<dayType>Business</dayType
<businessDayConvention>NON
<businessCenters>
<businessCenter>GBLO</busi
</businessCenters>
<dateRelativeTo href="floatingLeg2ResetDat
</fixingDates>
<resetFrequency>
<periodMultiplier>3</perio
<period>M</period>
</resetFrequency>
<resetDatesAdjustments>
<businessDayConvention>MOD
<businessCenters>
<businessCenter>GBLO</busi
<businessCenter>USNY</busi
</businessCenters>
</resetDatesAdjustments>
</resetDates>
<calculationPeriodAmount>
<calculation>
<notionalSchedule>
<notionalStepSchedule>
<initialValue>50000000</in
<currency>USD</currency>
</notionalStepSchedule>
</notionalSchedule>
<floatingRateCalculation>
<floatingRateIndex>USD-LIB
<indexTenor>
<periodMultiplier>3</perio
<period>M</period>
</indexTenor>
<initialRate>0.06</initial
</floatingRateCalculation>
<dayCountFraction>ACT/360<
</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=
</masterAgreement>
<contractualDefinitions>IS
</documentation>
</trade>
<party id="partyA">
<partyId>BB1TULLLE1</party
</party>
<party id="partyB">
<partyId>BB2TULLLE1</party
</party>
<party id="broker1">
<partyId>TULL_NY</partyId>
</party>
</FpML>
<swbExtendedTradeDetails>
<swbProductTerm>
<periodMultiplier>1</perio
<period>Y</period>
</swbProductTerm>
<swbMessageText>Brokerage to be invoiced directly with Tullett.</swbMessageText>
</swbExtendedTradeDetails>
</swbStructuredTradeDetail
</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="y
<xsl:value-of select="SWBML/swbHeader/sw
<xsl:text>
</xsl:text>
<!--<xsl:text disable-output-escaping="y
<xsl:apply-templates select="/SWBML/swbHeader/s
<!--<xsl:text disable-output-escaping="y
<xsl:apply-templates select="/SWBML/swbStructur
</xsl:template>
<xsl:template match="swbRecipient">
<xsl:param name="href" select="./partyReference/@
<xsl:param name="dealType" select="/SWBML/swbStructur
<xsl:param name="definingleg" select="'fixedLeg'"/>
<xsl:param name="definingpath" select="/SWBML/swbStructur
<!--<xsl:text disable-output-escaping="y
<xsl:choose>
<xsl:when test="$dealType = 'Single Currency Basis Swap'">
<xsl:call-template name="getRecipientInformat
<xsl:with-param name="href" select="$href"/>
<xsl:with-param name="payer" select="/SWBML/swbStructur
<xsl:with-param name="receiver" select="/SWBML/swbStructur
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="getRecipientInformat
<xsl:with-param name="href" select="$href"/>
<xsl:with-param name="payer" select="/SWBML/swbStructur
<xsl:with-param name="receiver" select="/SWBML/swbStructur
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="getRecipientInformat
<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="y
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:when test="$receiver/@href = $href">
<xsl:text disable-output-escaping="y
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:text disable-output-escaping="y
<xsl:value-of select="@id"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="party">
<xsl:param name="href" select="./@id"/>
<xsl:param name="dealType" select="/SWBML/swbStructur
<xsl:param name="definingleg" select="'floatingLeg'"/>
<xsl:param name="definingpath" select="/SWBML/swbStructur
<xsl:choose>
<!--<xsl:when test="$dealType = 'Single Currency Basis Swap'">-->
<!--<xsl:call-template name="getFraSwiftInformati
<!--<xsl:with-param name="href" select="$href"/>-->
<!--</xsl:call-template>--
<!--</xsl:when>-->
<xsl:when test="$dealType = 'CDS'">
<xsl:call-template name="getCDSSwiftInformati
<xsl:with-param name="href" select="$href"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$definingpath[@id=$d
<xsl:call-template name="swiftStrip">
<xsl:with-param name="swiftId" select="./partyId/text()"/
<xsl:with-param name="payrec">
<xsl:text disable-output-escaping="y
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$definingpath[@id=$d
<xsl:call-template name="swiftStrip">
<xsl:with-param name="swiftId" select="./partyId/text()"/
<xsl:with-param name="payrec">
<xsl:text disable-output-escaping="y
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y
</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
<xsl:text>
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="getFraSwiftInformati
<xsl:param name="href"/>
<xsl:param name="definingpath" select="/SWBML/swbStructur
<xsl:choose>
<xsl:when test="$definingpath/buyerP
<xsl:call-template name="swiftStrip">
<xsl:with-param name="swiftId" select="./partyId/text()"/
<xsl:with-param name="payrec">
<xsl:text disable-output-escaping="y
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$definingpath/seller
<xsl:call-template name="swiftStrip">
<xsl:with-param name="swiftId" select="./partyId/text()"/
<xsl:with-param name="payrec">
<xsl:text disable-output-escaping="y
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y
</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template name="getCDSSwiftInformati
<xsl:param name="href"/>
<xsl:param name="definingpath" select="/SWBML/swbStructur
<xsl:choose>
<xsl:when test="$definingpath/buyerP
<xsl:call-template name="swiftStrip">
<xsl:with-param name="swiftId" select="./partyId/text()"/
<xsl:with-param name="payrec">
<xsl:text disable-output-escaping="y
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:when test="$definingpath/seller
<xsl:call-template name="swiftStrip">
<xsl:with-param name="swiftId" select="./partyId/text()"/
<xsl:with-param name="payrec">
<xsl:text disable-output-escaping="y
</xsl:with-param>
<xsl:with-param name="sspSide">
<xsl:text disable-output-escaping="y
</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
<xsl:text>
</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="y
<xsl:value-of select="$payrec"/>
<xsl:choose>
<xsl:when test="string-length(substr
<xsl:value-of select="substring-before($
<xsl:text>
</xsl:text>
<xsl:text disable-output-escaping="y
<xsl:value-of select="$sspSide"/>
<xsl:text>
</xsl:text>
</xsl:when>
<xsl:when test="string-length(substr
<xsl:value-of select="substring-before($
<xsl:text>
</xsl:text>
<xsl:text disable-output-escaping="y
<xsl:value-of select="$sspSide"/>
<xsl:text>
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$swiftId"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
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?
ASKER
Trying to Extract following node values from the XML
<swbBrokerTradeVersionId>1 5</swbBrok erTradeVer sionId> from the following XML Section
<swbHeader>
<swbBrokerTradeId>ALOK4_11 08299</swb BrokerTrad eId>
<swbBrokerTradeVersionId>1 5</swbBrok erTradeVer sionId>
<swbTradeSource>Voice</swb TradeSourc e>
<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/s wbRecipien t"/>
<xsl:apply-templates select="/SWBML/swbStructur edTradeDet ails/FpML/ party"/>
<swbBrokerTradeVersionId>1
<swbHeader>
<swbBrokerTradeId>ALOK4_11
<swbBrokerTradeVersionId>1
<swbTradeSource>Voice</swb
<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/s
<xsl:apply-templates select="/SWBML/swbStructur
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:s wbHeader/f pml:swbRec ipient"/>
it is an ugly task, but there is no other way in XSLT1
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:s
it is an ugly task, but there is no other way in XSLT1
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
ASKER
Perfecto, I did the same thing for something else but simply didn't pay attention. But thanks for your help.
welcome