0
저는 XSLT에서 몇 가지 기본적인 재 할당을 할 수 있기를 원합니다. 어떻게이 일을 성취 할 수 있습니까?XSLT에서 변수를 어떻게 재 할당합니까?
난 그냥합니다 (appendMonthWithZero() 함수를 무시) XSLT이 변환 할 수 있도록하려면 :
if(currentMonth + count > 12) //If we get past December onto a new year we need to reset the current month back to 01
{
currentMonth = (currentMonth + count) - 12; //e.g. 9 + 4 = 13, 13 - 12 = 1 (January). Or 9 + 11 = 20, 20 - 12 = 8 (August)
if(currentMonth < 10)
{
currentMonth = appendMonthWithZero();
}
}
지금까지 나는 XSLT이있다 그러나 그것은 작동하지 않습니다.
<xsl:if test="$currentMonth + $count > 12">
<xsl:param name="currentMonth" select="($currentMonth + $count) - 12"/>
</xsl:if>
이것은 내가 의사 전반적인 할 노력하고있어 본질적으로 무엇을 (http://pastebin.com/WsaZaKnC을) :
currentMonth = getCurrentMonth();
actualDateWithZero = appendMonthWithZero();
docs = getFlightResults();
monthsArray = ['Jan', 'Feb', 'Mar'.......];
for(count = 0; count < 12; count++)
{
outboundMonth = subString(doc[count+1].getOutboundMonth());
if(currentMonth + count > 12) //If we get past December onto a new year we need to reset the current month back to 01
{
currentMonth = (currentMonth + count) - 12; //e.g. 9 + 4 = 13, 13 - 12 = 1 (January). Or 9 + 11 = 20, 20 - 12 = 8 (August)
if(currentMonth < 10)
{
currentMonth = appendMonthWithZero();
}
}
//A price is available.
//Second check is for when we get past a new year
if(currentMonth + count == outboundBoundMonth || currentMonth == outboundMonth)
{
//Get rest of data from doc etc etc
//Set up divs etc etc
//Get string month with displayed Month [Jan, Feb, Mar....]
}
//Else no price available for this month
else
{
//display price not available
//Get string month with displayed Month [Jan, Feb, Mar....]
}
}
m2에 0을 추가 할 때 다시 다른 값을 할당해야합니까? –
값에 0을 추가하면 새 값인 yes가 작성됩니다. –