XSL help
XSLT: Version 1.0
Processor: Xalan-C_1_8_0-windows_2000-msvc_60 /xerces-c_2_5_0-windows_nt-msvc_60
Platform: Windows XP
Please note i have not posted any xml or xsl or output here.
Its possible to define the xsl as below algorithm
[u]Initialising: </u>$periods = null; $pp=null; $cc=null; $other=null
[u]In XSL i can able to write it as ?</u>
<xsl:variable name="periods" select="null"/>
<xsl:variable name="pp" select="null"/>
<xsl:variable name="cc" select="null"/>
<xsl:variable name="other" select="null"/>
[u]Algorithm:</u>
if $cc is null and $creditPeriods.hasNext() then $cc = nextConsecutivePeriod ($creditPeriods)
//
if $pp is null and $pastPeriods.hasNext() then $pp = nextConsecutivePeriod ($pastPeriods)
// If $cc and $pp exist, merge them
if $pp is not null and $cc is not null then
($pp, $cc, $other) = mergePeriods ($pp, $cc)
if $other is not null then $periods.add ($other)
// If only $pp, add directly to periods
else if $pp is not null then
$periods.add($pp)
$pp = null
// If only $cc, add to $periods
else if $cc is not null then
$periods.add($cc)
$cc = null
// Otherwise, nothing left then end
else
break
fi
end while
// Add advanced charge periods
while $advancedPeriods.hasNext()
$aa = nextConsecutivePeriod($advancedPeriods)
$periods.add(aa)
[u]In XSL i can able to write it as ?</u>
<xsl:if test="$cc='null' and $pastPeriods.hasNext()">
</xsl:if>
I dont know how to handle $pastPeriods.hasNext() in XSL. Since i am using the xalan extension function which the pastPeriods is an xsl variable contains the xml tree structure such as
<AccessFeesGroupList>
<AccessFeesGroup>
<Period dateFrom='<>' dateTo='<>' discountValue='<>' invoiceLineValue='<>' vatValue='<>' />"
</AccessFeesGroup>
</AccessFeesGroupList>
Please ignote that i have not posted the input xml and the expected output.
|