3

我有以下 XML 数据:

<Timesheet>
<WeekEnding>Oct 7, 2012</WeekEnding>
<JobNumber>Doe - 508</JobNumber>
<WGNumber>WG No.</WGNumber>
<Customer>Dummy Company</Customer>
<City>Raleigh</City>
<State>North Carolina</State>
<TeamMember>
    <EmployeeNumber>101010</EmployeeNumber>
    <EmployeeName>Doe, Joseph</EmployeeName>
    <EmployeeClass>UCL</EmployeeClass>
    <Monday>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>safety meeting</WorkOrderNumber>
            <RegularHours>.5</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Safety meeting</Notes>
        </TimeDetail>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>rain time</WorkOrderNumber>
            <RegularHours>2</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Rain time</Notes>
        </TimeDetail>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>777091</WorkOrderNumber>
            <RegularHours>7.5</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Capital blvd st lights</Notes>
        </TimeDetail>
    </Monday>
    <Tuesday>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>safety meeting</WorkOrderNumber>
            <RegularHours>.5</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Safety meeting</Notes>
        </TimeDetail>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>777091</WorkOrderNumber>
            <RegularHours>9.5</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Capital blvd st lights</Notes>
        </TimeDetail>
    </Tuesday>
    <Wednesday>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>5555591</WorkOrderNumber>
            <RegularHours>10</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Capital blvd st lights</Notes>
        </TimeDetail>
    </Wednesday>
    <Thursday>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>111122</WorkOrderNumber>
            <RegularHours>10</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>120 sigma dr</Notes>
        </TimeDetail>
    </Thursday>
    <Friday>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>999935</WorkOrderNumber>
            <RegularHours>Regular</RegularHours>
            <OverTimeHours>8</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>St light job Progress to pay half time</Notes>
        </TimeDetail>
    </Friday>
    <Saturday></Saturday>
    <Sunday></Sunday>
</TeamMember>
<TeamMember>
    <EmployeeNumber>606060</EmployeeNumber>
    <EmployeeName>Does, Stephen</EmployeeName>
    <EmployeeClass>EO</EmployeeClass>
    <Monday>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>safety meeting</WorkOrderNumber>
            <RegularHours>.5</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Safety meeting</Notes>
        </TimeDetail>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>rain time</WorkOrderNumber>
            <RegularHours>2</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Rain time</Notes>
        </TimeDetail>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>777091</WorkOrderNumber>
            <RegularHours>7.5</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Capital blvd st lights</Notes>
        </TimeDetail>
    </Monday>
    <Tuesday>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>safety meeting</WorkOrderNumber>
            <RegularHours>.5</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Safety meeting</Notes>
        </TimeDetail>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>777091</WorkOrderNumber>
            <RegularHours>9.5</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Capital blvd st lights</Notes>
        </TimeDetail>
    </Tuesday>
    <Wednesday>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>5555591</WorkOrderNumber>
            <RegularHours>10</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Capital blvd st lights</Notes>
        </TimeDetail>
    </Wednesday>
    <Thursday></Thursday>
    <Friday></Friday>
    <Saturday></Saturday>
    <Sunday></Sunday>
</TeamMember>
<TeamMember>
    <EmployeeNumber>707070</EmployeeNumber>
    <EmployeeName>Hancock, Samuel</EmployeeName>
    <EmployeeClass>EO</EmployeeClass>
    <Monday></Monday>
    <Tuesday></Tuesday>
    <Wednesday>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>5555591</WorkOrderNumber>
            <RegularHours>10</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>Capital blvd st lights</Notes>
        </TimeDetail>
    </Wednesday>
    <Thursday></Thursday>
    <Friday></Friday>
    <Saturday></Saturday>
    <Sunday></Sunday>
</TeamMember>
<TeamMember>
    <EmployeeNumber>808080</EmployeeNumber>
    <EmployeeName>Franklin, Ben</EmployeeName>
    <EmployeeClass>EO</EmployeeClass>
    <Monday></Monday>
    <Tuesday></Tuesday>
    <Wednesday></Wednesday>
    <Thursday>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>111122</WorkOrderNumber>
            <RegularHours>10</RegularHours>
            <OverTimeHours>Over Time</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>120 sigma dr</Notes>
        </TimeDetail>
    </Thursday>
    <Friday></Friday>
    <Saturday></Saturday>
    <Sunday></Sunday>
</TeamMember>
<TeamMember>
    <EmployeeNumber>909090</EmployeeNumber>
    <EmployeeName>Doess, Smith</EmployeeName>
    <EmployeeClass>UCL</EmployeeClass>
    <Monday></Monday>
    <Tuesday></Tuesday>
    <Wednesday></Wednesday>
    <Thursday></Thursday>
    <Friday>
        <TimeDetail>
            <StartTime>Start</StartTime>
            <StopTime>Stop</StopTime>
            <WorkOrderNumber>999935</WorkOrderNumber>
            <RegularHours>4</RegularHours>
            <OverTimeHours>4</OverTimeHours>
            <OtherHours>Other</OtherHours>
            <PerDiem>NO</PerDiem>
            <Notes>St light job Progress to pay half time</Notes>
        </TimeDetail>
    </Friday>
    <Saturday></Saturday>
    <Sunday></Sunday>
</TeamMember>

我正在遍历员工并使用以下循环显示数据:

<xsl:for-each select="Timesheet/TeamMember[EmployeeNumber!='Employee No.']"></xsl:for-each>

在该循环中,我需要执行另一个循环,该循环将显示员工循环当前位置的不同工作订单。下面是我一直在使用的一些代码。问题是它返回整个 XML 文件而不是当前员工的所有不同工单。我已经反复修改了几个小时,但我要么得到 XML 文件中的所有工作订单,要么得到 0。有人能给我一点帮助吗?谢谢。

我在 XSLT 的顶部声明了这个键

<xsl:key name="distinctWorkOrder" match="//WorkOrderNumber" use="."></xsl:key>

这是我一直试图为员工获取工作订单的循环

<xsl:for-each select="..//WorkOrderNumber[generate-id() = generate-id(key('distinctWorkOrder', .)[1])][//EmployeeNumber=$empId])">

更新:输出是 HTML。为了显示员工信息,我这样做了:

<tr style="height:20px;">
                        <td class="normalBorders" style="text-align:left;">Name</td>
                        <td class="borderT" style="text-align:center;">
                            <div style="border-bottom:1px solid black;height:12px;width:200px;">
                                <xsl:value-of select="EmployeeName"></xsl:value-of>
                            </div>
                        </td>
                        <td colspan="2" class="borderT" style="text-align:right;">Emp. ID#</td>
                        <td colspan="2" class="borderT" style="text-align:center">
                            <div style="border-bottom:1px solid black;height:15px; width:100%;display:inline-block;">
                                <xsl:value-of select="EmployeeNumber"/>
                            </div>
                        </td>
                        <td colspan="2" class="borderT">&#160;</td>
                        <td rowspan="2" colspan="4" class="borderT borderR">
                            <div style="width:100%;height:27px;border-bottom:1px solid black;">
                                <img src="{../Signatures/Path}" style="width:100%;height:34px;"/>
                            </div>
                        </td>
                    </tr>
                    <tr style="height:20px;">
                        <td class="borderL" style="text-align:left;">Sign/Date</td>
                        <td style="text-align:center;">
                            <div style="border-bottom:1px solid black;height:12px;width:200px;">
                                <xsl:value-of select="EmployeeName"></xsl:value-of>
                            </div>
                        </td>
                        <td colspan="5">&#160;</td>
                        <td style="text-align:right;">Approved</td>
                    </tr>

这里我需要循环输出类似这样的工单数据

<xsl:for-each select="..//WorkOrderNumber[generate-id() = generate-id(key('distinctWorkOrder', .)[1])][//EmployeeNumber=$empId])">
<tr>
                 <td class="normalBorders"><xsl:value-of select="//WorkOrderNumber"/></td>
               <td>Other data</td>
    </tr>

4

1 回答 1

1

下面是如何做到这一点(HTML 格式留给读者作为练习):

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output omit-xml-declaration="yes" indent="yes"/>
 <xsl:strip-space elements="*"/>

 <xsl:key name="kEmpOrder"
  match="TeamMember[not(EmployeeNumber='Employee No.')]/*/*/WorkOrderNumber"
  use="concat(../../../EmployeeNumber, '+', .)"/>

 <xsl:template match="TeamMember">
  <Employee>
     <xsl:copy-of select="*[starts-with(name(), 'Employee')]"/>
     <WorkOrders>
      <xsl:copy-of select=
      "*/*/WorkOrderNumber
           [generate-id()
           =
            generate-id(key('kEmpOrder',
                             concat(../../../EmployeeNumber, '+', .)
                             )[1]
                      )
         ]
      "/>
     </WorkOrders>
    </Employee>
 </xsl:template>
 <xsl:template match="text()"/>
</xsl:stylesheet>

当此转换应用于提供的 XML 文档时

<Timesheet>
    <WeekEnding>Oct 7, 2012</WeekEnding>
    <JobNumber>Doe - 508</JobNumber>
    <WGNumber>WG No.</WGNumber>
    <Customer>Dummy Company</Customer>
    <City>Raleigh</City>
    <State>North Carolina</State>
    <TeamMember>
        <EmployeeNumber>101010</EmployeeNumber>
        <EmployeeName>Doe, Joseph</EmployeeName>
        <EmployeeClass>UCL</EmployeeClass>
        <Monday>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>safety meeting</WorkOrderNumber>
                <RegularHours>.5</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Safety meeting</Notes>
            </TimeDetail>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>rain time</WorkOrderNumber>
                <RegularHours>2</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Rain time</Notes>
            </TimeDetail>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>777091</WorkOrderNumber>
                <RegularHours>7.5</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Capital blvd st lights</Notes>
            </TimeDetail>
        </Monday>
        <Tuesday>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>safety meeting</WorkOrderNumber>
                <RegularHours>.5</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Safety meeting</Notes>
            </TimeDetail>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>777091</WorkOrderNumber>
                <RegularHours>9.5</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Capital blvd st lights</Notes>
            </TimeDetail>
        </Tuesday>
        <Wednesday>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>5555591</WorkOrderNumber>
                <RegularHours>10</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Capital blvd st lights</Notes>
            </TimeDetail>
        </Wednesday>
        <Thursday>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>111122</WorkOrderNumber>
                <RegularHours>10</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>120 sigma dr</Notes>
            </TimeDetail>
        </Thursday>
        <Friday>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>999935</WorkOrderNumber>
                <RegularHours>Regular</RegularHours>
                <OverTimeHours>8</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>St light job Progress to pay half time</Notes>
            </TimeDetail>
        </Friday>
        <Saturday></Saturday>
        <Sunday></Sunday>
    </TeamMember>
    <TeamMember>
        <EmployeeNumber>606060</EmployeeNumber>
        <EmployeeName>Does, Stephen</EmployeeName>
        <EmployeeClass>EO</EmployeeClass>
        <Monday>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>safety meeting</WorkOrderNumber>
                <RegularHours>.5</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Safety meeting</Notes>
            </TimeDetail>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>rain time</WorkOrderNumber>
                <RegularHours>2</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Rain time</Notes>
            </TimeDetail>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>777091</WorkOrderNumber>
                <RegularHours>7.5</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Capital blvd st lights</Notes>
            </TimeDetail>
        </Monday>
        <Tuesday>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>safety meeting</WorkOrderNumber>
                <RegularHours>.5</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Safety meeting</Notes>
            </TimeDetail>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>777091</WorkOrderNumber>
                <RegularHours>9.5</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Capital blvd st lights</Notes>
            </TimeDetail>
        </Tuesday>
        <Wednesday>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>5555591</WorkOrderNumber>
                <RegularHours>10</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Capital blvd st lights</Notes>
            </TimeDetail>
        </Wednesday>
        <Thursday></Thursday>
        <Friday></Friday>
        <Saturday></Saturday>
        <Sunday></Sunday>
    </TeamMember>
    <TeamMember>
        <EmployeeNumber>707070</EmployeeNumber>
        <EmployeeName>Hancock, Samuel</EmployeeName>
        <EmployeeClass>EO</EmployeeClass>
        <Monday></Monday>
        <Tuesday></Tuesday>
        <Wednesday>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>5555591</WorkOrderNumber>
                <RegularHours>10</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>Capital blvd st lights</Notes>
            </TimeDetail>
        </Wednesday>
        <Thursday></Thursday>
        <Friday></Friday>
        <Saturday></Saturday>
        <Sunday></Sunday>
    </TeamMember>
    <TeamMember>
        <EmployeeNumber>808080</EmployeeNumber>
        <EmployeeName>Franklin, Ben</EmployeeName>
        <EmployeeClass>EO</EmployeeClass>
        <Monday></Monday>
        <Tuesday></Tuesday>
        <Wednesday></Wednesday>
        <Thursday>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>111122</WorkOrderNumber>
                <RegularHours>10</RegularHours>
                <OverTimeHours>Over Time</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>120 sigma dr</Notes>
            </TimeDetail>
        </Thursday>
        <Friday></Friday>
        <Saturday></Saturday>
        <Sunday></Sunday>
    </TeamMember>
    <TeamMember>
        <EmployeeNumber>909090</EmployeeNumber>
        <EmployeeName>Doess, Smith</EmployeeName>
        <EmployeeClass>UCL</EmployeeClass>
        <Monday></Monday>
        <Tuesday></Tuesday>
        <Wednesday></Wednesday>
        <Thursday></Thursday>
        <Friday>
            <TimeDetail>
                <StartTime>Start</StartTime>
                <StopTime>Stop</StopTime>
                <WorkOrderNumber>999935</WorkOrderNumber>
                <RegularHours>4</RegularHours>
                <OverTimeHours>4</OverTimeHours>
                <OtherHours>Other</OtherHours>
                <PerDiem>NO</PerDiem>
                <Notes>St light job Progress to pay half time</Notes>
            </TimeDetail>
        </Friday>
        <Saturday></Saturday>
        <Sunday></Sunday>
    </TeamMember>
</Timesheet>

产生了想要的、正确分组的结果:

<Employee>
   <EmployeeNumber>101010</EmployeeNumber>
   <EmployeeName>Doe, Joseph</EmployeeName>
   <EmployeeClass>UCL</EmployeeClass>
   <WorkOrders>
      <WorkOrderNumber>safety meeting</WorkOrderNumber>
      <WorkOrderNumber>rain time</WorkOrderNumber>
      <WorkOrderNumber>777091</WorkOrderNumber>
      <WorkOrderNumber>5555591</WorkOrderNumber>
      <WorkOrderNumber>111122</WorkOrderNumber>
      <WorkOrderNumber>999935</WorkOrderNumber>
   </WorkOrders>
</Employee>
<Employee>
   <EmployeeNumber>606060</EmployeeNumber>
   <EmployeeName>Does, Stephen</EmployeeName>
   <EmployeeClass>EO</EmployeeClass>
   <WorkOrders>
      <WorkOrderNumber>safety meeting</WorkOrderNumber>
      <WorkOrderNumber>rain time</WorkOrderNumber>
      <WorkOrderNumber>777091</WorkOrderNumber>
      <WorkOrderNumber>5555591</WorkOrderNumber>
   </WorkOrders>
</Employee>
<Employee>
   <EmployeeNumber>707070</EmployeeNumber>
   <EmployeeName>Hancock, Samuel</EmployeeName>
   <EmployeeClass>EO</EmployeeClass>
   <WorkOrders>
      <WorkOrderNumber>5555591</WorkOrderNumber>
   </WorkOrders>
</Employee>
<Employee>
   <EmployeeNumber>808080</EmployeeNumber>
   <EmployeeName>Franklin, Ben</EmployeeName>
   <EmployeeClass>EO</EmployeeClass>
   <WorkOrders>
      <WorkOrderNumber>111122</WorkOrderNumber>
   </WorkOrders>
</Employee>
<Employee>
   <EmployeeNumber>909090</EmployeeNumber>
   <EmployeeName>Doess, Smith</EmployeeName>
   <EmployeeClass>UCL</EmployeeClass>
   <WorkOrders>
      <WorkOrderNumber>999935</WorkOrderNumber>
   </WorkOrders>
</Employee>

说明

正确使用带有复合键的Muenchian 分组方法。

于 2012-11-20T18:51:40.283 回答