XML:
<Calendars xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Urnik.xsd">
<Calendar>
<Name>Marko</Name>
<Days>
<Day>
<Date>2013-05-13</Date>
<DayType>1</DayType>
<DayWorking>1</DayWorking>
<WorkingTimes>
<WorkingTime>
<FromTime>08:00</FromTime>
<ToTime>11:00</ToTime>
<Name>Izpit Matematika</Name>
<Owner>Marko</Owner>
<Category>
<School Professor="111" Room="1" Subject="882" />
</Category>
</WorkingTime>
<WorkingTime>
<FromTime>13:00</FromTime>
<ToTime>17:00</ToTime>
<Name>Vaje APZ</Name>
<Owner>Marko</Owner>
<Category>
<School Professor="222" Room="11" Subject="881"/>
</Category>
</WorkingTime>
<WorkingTime>
<FromTime>20:00</FromTime>
<ToTime>22:00</ToTime>
<Name>Vaje aaaaaa</Name>
<Owner>Marko</Owner>
<Category>
<School Professor="222" Room="11" Subject="881"/>
</Category>
</WorkingTime>
</WorkingTimes>
</Day>
<Day>
<Date>2013-05-14</Date>
<DayType>2</DayType>
...
</Day>
XSLT:
<xsl:for-each select="Calendar/Days/Day">
<xsl:choose>
<xsl:when test="DayType = 1">
<xsl:variable name="vTransfers" select="/*/WorkingTime"/>
<xsl:value-of select="$vTransfers[1]" />
我正在循环Day
节点。然后我想将所有WorkingTime
节点存储DayType = 1
到数组中。不循环它,而是将它存储在数组中,因为我稍后会在正确的 td 标记中打印它
但是是空的,但我希望得到:
<WorkingTime>
<FromTime>08:00</FromTime>
<ToTime>11:00</ToTime>
<Name>Izpit Matematika</Name>
<Owner>Marko</Owner>
<Category>
<School Professor="111" Room="1" Subject="882" />
</Category>
</WorkingTime>
你能给我一些线索吗?