2016-05-27 4 views
1

Я пытаюсь преобразовать XML с помощью XSL 2.0 это входящий XMLXSL 2.0 отчетливых-значения в пределах для каждого отдельного цикла значения

<sprints> 
    <sprint> 
     <sprintid>260</sprintid> 
     <name>-</name> 
     <startdate>05-26-2016</startdate> 
     <enddate>06-09-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>6</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>56</biid> 
       <name>test14</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-23 13:45:21.0</createdat> 
       <updatedat>2016-05-23 13:45:21.0</updatedat> 
       <priority>0</priority> 
       <size>8</size> 
       <enddate>06-09-2016</enddate> 
      </item> 
     </items> 
     <testenddate>06-09-2016</testenddate> 
     <csv>Summary,IssueType,Description,DueDate,Story Points 
      test14,story,,,8 
     </csv> 
    <sprint> 
     <sprintid>262</sprintid> 
     <name /> 
     <startdate>06-23-2016</startdate> 
     <enddate>07-07-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>12</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>59</biid> 
       <name>test689</name> 
       <description>-</description> 
       <targetdate>2017-05-23</targetdate> 
       <bid>5</bid> 
       <createdat>2016-05-23 13:53:21.0</createdat> 
       <updatedat>2016-05-23 19:12:20.0</updatedat> 
       <priority>1</priority> 
       <size>11</size> 
       <enddate>07-07-2016</enddate> 
      </item> 
      <item> 
       <biid>57</biid> 
       <name>sdfdsf</name> 
       <description>-</description> 
       <targetdate>2016-05-18</targetdate> 
       <bid>5</bid> 
       <createdat>2016-05-23 13:51:15.0</createdat> 
       <updatedat>2016-05-23 19:11:33.0</updatedat> 
       <priority>2</priority> 
       <size>11</size> 
       <enddate>07-07-2016</enddate> 
      </item> 
     </items> 
     <testenddate>07-07-2016</testenddate> 
     <csv>Summary,IssueType,Description,DueDate,Story Points 
      test689,story,-,2017-05-23,11 
      sdfdsf,story,-,2016-05-18,11 
     </csv> 
    </sprint> 
    <sprint> 
     <sprintid>263</sprintid> 
     <name /> 
     <startdate>07-07-2016</startdate> 
     <enddate>07-21-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>12</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>60</biid> 
       <name>test09</name> 
       <description>-</description> 
       <targetdate>2017-05-23</targetdate> 
       <bid>5</bid> 
       <createdat>2016-05-23 13:54:30.0</createdat> 
       <updatedat>2016-05-23 19:23:22.0</updatedat> 
       <priority>3</priority> 
       <size>2</size> 
       <enddate>07-21-2016</enddate> 
      </item> 
      <item> 
       <biid>88</biid> 
       <name>tets89</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 13:41:06.0</createdat> 
       <updatedat>2016-05-26 13:41:06.0</updatedat> 
       <priority>4</priority> 
       <size>100</size> 
       <enddate>07-21-2016</enddate> 
      </item> 
     </items> 
     <testenddate>07-21-2016</testenddate> 
     <csv>Summary,IssueType,Description,DueDate,Story Points 
      test09,story,-,2017-05-23,2 
      tets89,story,,,100 
     </csv> 
    </sprint> 
    <sprint> 
     <sprintid>264</sprintid> 
     <name /> 
     <startdate>07-21-2016</startdate> 
     <enddate>08-04-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>12</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>88</biid> 
       <name>tets89</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 13:41:06.0</createdat> 
       <updatedat>2016-05-26 13:41:06.0</updatedat> 
       <priority>4</priority> 
       <size>100</size> 
       <enddate>08-04-2016</enddate> 
      </item> 
     </items> 
     <testenddate>08-04-2016</testenddate> 
     <csv>Summary,IssueType,Description,DueDate,Story Points 
      tets89,story,,,100 
     </csv> 
    </sprint> 
    <sprint> 
     <sprintid>265</sprintid> 
     <name /> 
     <startdate>08-04-2016</startdate> 
     <enddate>08-18-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>12</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>88</biid> 
       <name>tets89</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 13:41:06.0</createdat> 
       <updatedat>2016-05-26 13:41:06.0</updatedat> 
       <priority>4</priority> 
       <size>100</size> 
       <enddate>08-18-2016</enddate> 
      </item> 
     </items> 
     <testenddate>08-18-2016</testenddate> 
     <csv>Summary,IssueType,Description,DueDate,Story Points 
      tets89,story,,,100 
     </csv> 
    </sprint> 
    <sprint> 
     <sprintid>266</sprintid> 
     <name /> 
     <startdate>08-18-2016</startdate> 
     <enddate>09-01-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>12</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>88</biid> 
       <name>tets89</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 13:41:06.0</createdat> 
       <updatedat>2016-05-26 13:41:06.0</updatedat> 
       <priority>4</priority> 
       <size>100</size> 
       <enddate>09-01-2016</enddate> 
      </item> 
     </items> 
     <testenddate>09-01-2016</testenddate> 
     <csv>Summary,IssueType,Description,DueDate,Story Points 
      tets89,story,,,100 
     </csv> 
    </sprint> 
    <sprint> 
     <sprintid>267</sprintid> 
     <name /> 
     <startdate>09-01-2016</startdate> 
     <enddate>09-15-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>12</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>88</biid> 
       <name>tets89</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 13:41:06.0</createdat> 
       <updatedat>2016-05-26 13:41:06.0</updatedat> 
       <priority>4</priority> 
       <size>100</size> 
       <enddate>09-15-2016</enddate> 
      </item> 
     </items> 
     <testenddate>09-15-2016</testenddate> 
     <csv>Summary,IssueType,Description,DueDate,Story Points 
      tets89,story,,,100 
     </csv> 
    </sprint> 
    <sprint> 
     <sprintid>268</sprintid> 
     <name /> 
     <startdate>09-15-2016</startdate> 
     <enddate>09-29-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>88</biid> 
       <name>tets89</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 13:41:06.0</createdat> 
       <updatedat>2016-05-26 13:41:06.0</updatedat> 
       <priority>4</priority> 
       <size>100</size> 
       <enddate>September</enddate> 
      </item> 
     </items> 
     <testenddate>September</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>269</sprintid> 
     <name /> 
     <startdate>09-29-2016</startdate> 
     <enddate>10-13-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>88</biid> 
       <name>tets89</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 13:41:06.0</createdat> 
       <updatedat>2016-05-26 13:41:06.0</updatedat> 
       <priority>4</priority> 
       <size>100</size> 
       <enddate>October</enddate> 
      </item> 
     </items> 
     <testenddate>October</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>270</sprintid> 
     <name /> 
     <startdate>10-13-2016</startdate> 
     <enddate>10-27-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>88</biid> 
       <name>tets89</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 13:41:06.0</createdat> 
       <updatedat>2016-05-26 13:41:06.0</updatedat> 
       <priority>4</priority> 
       <size>100</size> 
       <enddate>October</enddate> 
      </item> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>October</enddate> 
      </item> 
     </items> 
     <testenddate>October</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>271</sprintid> 
     <name /> 
     <startdate>10-27-2016</startdate> 
     <enddate>11-10-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>November</enddate> 
      </item> 
     </items> 
     <testenddate>November</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>272</sprintid> 
     <name /> 
     <startdate>11-10-2016</startdate> 
     <enddate>11-24-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>November</enddate> 
      </item> 
     </items> 
     <testenddate>November</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>273</sprintid> 
     <name /> 
     <startdate>11-24-2016</startdate> 
     <enddate>12-08-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>December</enddate> 
      </item> 
     </items> 
     <testenddate>December</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>274</sprintid> 
     <name /> 
     <startdate>12-08-2016</startdate> 
     <enddate>12-22-2016</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>December</enddate> 
      </item> 
     </items> 
     <testenddate>December</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>275</sprintid> 
     <name /> 
     <startdate>12-22-2016</startdate> 
     <enddate>01-05-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>January</enddate> 
      </item> 
     </items> 
     <testenddate>January</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>278</sprintid> 
     <name /> 
     <startdate>02-02-2017</startdate> 
     <enddate>02-16-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q1</enddate> 
      </item> 
     </items> 
     <testenddate>Q1</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>279</sprintid> 
     <name /> 
     <startdate>02-16-2017</startdate> 
     <enddate>03-02-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q1</enddate> 
      </item> 
     </items> 
     <testenddate>Q1</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>280</sprintid> 
     <name /> 
     <startdate>03-02-2017</startdate> 
     <enddate>03-16-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q1</enddate> 
      </item> 
     </items> 
     <testenddate>Q1</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>281</sprintid> 
     <name /> 
     <startdate>03-16-2017</startdate> 
     <enddate>03-30-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q1</enddate> 
      </item> 
     </items> 
     <testenddate>Q1</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>282</sprintid> 
     <name /> 
     <startdate>03-30-2017</startdate> 
     <enddate>04-13-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q2</enddate> 
      </item> 
     </items> 
     <testenddate>Q2</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>283</sprintid> 
     <name /> 
     <startdate>04-13-2017</startdate> 
     <enddate>04-27-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q2</enddate> 
      </item> 
     </items> 
     <testenddate>Q2</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>284</sprintid> 
     <name /> 
     <startdate>04-27-2017</startdate> 
     <enddate>05-11-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q2</enddate> 
      </item> 
     </items> 
     <testenddate>Q2</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>285</sprintid> 
     <name /> 
     <startdate>05-11-2017</startdate> 
     <enddate>05-25-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q2</enddate> 
      </item> 
     </items> 
     <testenddate>Q2</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>286</sprintid> 
     <name /> 
     <startdate>05-25-2017</startdate> 
     <enddate>06-08-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q2</enddate> 
      </item> 
     </items> 
     <testenddate>Q2</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>287</sprintid> 
     <name /> 
     <startdate>06-08-2017</startdate> 
     <enddate>06-22-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q2</enddate> 
      </item> 
     </items> 
     <testenddate>Q2</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>288</sprintid> 
     <name /> 
     <startdate>06-22-2017</startdate> 
     <enddate>07-06-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q3</enddate> 
      </item> 
     </items> 
     <testenddate>Q3</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>289</sprintid> 
     <name /> 
     <startdate>07-06-2017</startdate> 
     <enddate>07-20-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q3</enddate> 
      </item> 
     </items> 
     <testenddate>Q3</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>290</sprintid> 
     <name /> 
     <startdate>07-20-2017</startdate> 
     <enddate>08-03-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q3</enddate> 
      </item> 
     </items> 
     <testenddate>Q3</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>291</sprintid> 
     <name /> 
     <startdate>08-03-2017</startdate> 
     <enddate>08-17-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q3</enddate> 
      </item> 
     </items> 
     <testenddate>Q3</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>292</sprintid> 
     <name /> 
     <startdate>08-17-2017</startdate> 
     <enddate>08-31-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>20</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q3</enddate> 
      </item> 
     </items> 
     <testenddate>Q3</testenddate> 
    </sprint> 
    <sprint> 
     <sprintid>293</sprintid> 
     <name /> 
     <startdate>08-31-2017</startdate> 
     <enddate>09-14-2017</enddate> 
     <weeks>2</weeks> 
     <capacity>300</capacity> 
     <teamid>5</teamid> 
     <items> 
      <item> 
       <biid>90</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-26 16:53:52.0</createdat> 
       <updatedat>2016-05-26 16:53:52.0</updatedat> 
       <priority>5</priority> 
       <size>500</size> 
       <enddate>Q3</enddate> 
      </item> 
      <item> 
       <biid>91</biid> 
       <name>testt</name> 
       <description /> 
       <targetdate /> 
       <bid>5</bid> 
       <createdat>2016-05-27 03:40:23.0</createdat> 
       <updatedat>2016-05-27 03:40:23.0</updatedat> 
       <priority>6</priority> 
       <size>4</size> 
       <enddate>Q3</enddate> 
      </item> 
     </items> 
     <testenddate>Q3</testenddate> 
    </sprint> 
    <result>Ok</result> 
</sprints> 

я пытаюсь получить все различен спринт и в пределах этих различных спринтов я хотел бы видеть все отдельные элементы, принадлежащие к спринту. для того, чтобы сделать это здесь мой XSL

<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0"> 
    <xsl:output method="xml" indent="yes" /> 
    <xsl:variable name="sprints" select="sprints/sprint" /> 
    <xsl:variable name="items" select="sprints/sprint/items/item" /> 
    <xsl:template match="/"> 
     <root> 
      <sprints> 
    <xsl:for-each select="distinct-values(sprints/sprint/testenddate)"> 
        <sprint> 
         <enddate><xsl:value-of select="." /></enddate> 
         <items> 
        <xsl:for-each select="distinct-values($items/biid)"> 
          <item> 
          <xsl:value-of select="." /> 
          </item> 
          </xsl:for-each> 
         </items> 
        </sprint> 
       </xsl:for-each> 
      </sprints> 
     </root> 
    </xsl:template> 
</xsl:stylesheet> 

выход не то, что я ожидал:

<?xml version="1.0" encoding="UTF-8"?> 
<root xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
    <sprints> 
     <sprint> 
     <enddate>06-09-2016</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>06-23-2016</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>07-07-2016</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>07-21-2016</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>09-15-2016</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>September</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>October</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>November</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>December</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>January</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>Q1</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>Q2</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
     <sprint> 
     <enddate>Q3</enddate> 
     <items> 
      <item>56</item> 
      <item>59</item> 
      <item>57</item> 
      <item>60</item> 
      <item>88</item> 
      <item>90</item> 
      <item>91</item> 
     </items> 
     </sprint> 
    </sprints> 
</root> 

спринта различны, но все элементы отображаются во всех спринтов, я хочу соответствовать с правильным спринтом. Как я могу это сделать?

+0

У меня нет времени для полного ответа прямо сейчас, так вот подсказка: переменной '$' детали содержат каждый 'спринт/спринт/пункты/пункт 'из всего файла. Это помогает? BTW, поздравляю с хорошо написанным первым вопросом, которые здесь не хватает :-( –

+0

@ Jim Garrison: thank you – fasln01

ответ

1

Вот одно из решений.

<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0"> 
    <xsl:output method="xml" indent="yes" /> 
    <xsl:variable name="sprints" select="/sprints/sprint" /> 
    <xsl:template match="/"> 
     <root> 
      <sprints> 
       <xsl:for-each select="distinct-values(sprints/sprint/testenddate)"> 
        <xsl:variable name="date" select="."/> 
        <sprint> 
         <enddate><xsl:value-of select="." /></enddate> 
         <items> 
          <xsl:for-each select="distinct-values($sprints[testenddate/text()=$date]/items/item/biid)"> 
           <item> 
            <xsl:value-of select="." /> 
           </item> 
          </xsl:for-each> 
         </items> 
        </sprint> 
       </xsl:for-each> 
      </sprints> 
     </root> 
    </xsl:template> 
</xsl:stylesheet> 

А вот такое же решение, написанное с использованием группированием функций XSLT 2.0, в переменных не нужно:

<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0"> 
    <xsl:output method="xml" indent="yes" /> 
    <xsl:template match="/"> 
     <root> 
      <sprints> 
       <xsl:for-each-group select="/sprints/sprint" group-by="testenddate"> 
        <sprint> 
         <enddate><xsl:value-of select="current-grouping-key()"/></enddate> 
         <items> 
          <xsl:for-each select="distinct-values(current-group()/items/item/biid)"> 
           <item> 
            <xsl:value-of select="." /> 
           </item> 
          </xsl:for-each> 
         </items> 
        </sprint> 
       </xsl:for-each-group> 
      </sprints> 
     </root> 
    </xsl:template> 
</xsl:stylesheet> 
+0

Да, ключ группировки решил мою проблему. Никогда не ожидал таких быстрых и ясных ответов в такой короткой сумме времени! благодарность – fasln01

+0

В то время как мое решение работает, вы должны, вероятно, также обратить внимание на ответ @ MichaelKay, учитывая, что он является автором библии XSLT. –

3

Это гораздо легче достичь с помощью XSL: для-каждой группы, а не distinct- значения, поскольку разные значения дают только отличные значения даты, тогда как для каждой группы вы получаете группу спринтов, имеющих каждое отдельное значение даты.

Так что вы хотите что-то вроде:

<xsl:for-each-group select="/sprints/sprint" group-by="enddate"> 
    <sprint> 
    <enddate><xsl:value-of select="current-grouping-key()"/></enddate> 
    <items> 
     <xsl:for-each-group select="current-group()/item" group-by="biid"> 
      ... 
     </xsl:for-each-group> 
    </items> 
</sprint> 
</xsl:for-each-group> 
+0

Да, ключ группировки решил мою проблему. Никогда не ожидал таких быстрых и ясных ответов за такое короткое время! благодарность – fasln01