拆分xml有效负载并将xml转换为表,tr和tds

时间:2011-06-24 07:30:32

标签: xslt

<FinalCorporationDetails>
  <CorpDetails xmlns:ns2="http://www.portal.nv.gov/FinalCorporationDetails" xmlns="http://www.portal.nv.gov/FinalCorporationDetails">
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV20111227763</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>645 UTAH HOLDINGS LLC</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/04/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Articles of Organization</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">46</ns2:UserId>
    </ns2:FinalCorpDetails>
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV20111227763</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>645 UTAH HOLDINGS LLC</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/04/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Initial List</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">46</ns2:UserId>
    </ns2:FinalCorpDetails>
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV20111227802</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>SALERA TOOLS INC</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/04/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Articles of Incorporation</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">82</ns2:UserId>
    </ns2:FinalCorpDetails>
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV051120119</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>FORT APACHE-RUSSELL HOLDINGS LLC</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/05/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Articles of Organization</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">237</ns2:UserId>
    </ns2:FinalCorpDetails>
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV0511201114</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>SCCF CRAIG, LLC</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/05/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Articles of Organization</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">237</ns2:UserId>
    </ns2:FinalCorpDetails>
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV0511201119</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>FUNDRAISING AUTOMATION SERVICES AND TECHNOLOGY LLC</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/05/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Articles of Organization</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">237</ns2:UserId>
    </ns2:FinalCorpDetails>
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV0511201129</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>BRANDON USA LLC</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/05/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Articles of Organization</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">237</ns2:UserId>
    </ns2:FinalCorpDetails>
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV0511201130</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>FAITH HOLDINGS, INC.</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/05/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Articles of Incorporation</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">237</ns2:UserId>
    </ns2:FinalCorpDetails>
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV0511201131</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>AZZURRA CONCEPTS, LLC</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/05/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Articles of Organization</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">237</ns2:UserId>
    </ns2:FinalCorpDetails>
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV0511201134</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>CHANGE SOLUTIONS INC</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/05/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Articles of Incorporation</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">237</ns2:UserId>
    </ns2:FinalCorpDetails>
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV0511201135</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>MAB ENTERPRISES, LLC</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/05/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Articles of Organization</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">237</ns2:UserId>
    </ns2:FinalCorpDetails>
    <ns2:FinalCorpDetails>
      <ns2:businessIdVariable>NV0511201140</ns2:businessIdVariable>
      <ns2:businessEntityNameVariable>MME HOLDINGS LTD</ns2:businessEntityNameVariable>
      <ns2:businessActionDateVariable>04/05/2011</ns2:businessActionDateVariable>
      <ns2:businessActionsVariable>Articles of Organization</ns2:businessActionsVariable>
      <ns2:UserId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="">237</ns2:UserId>
    </ns2:FinalCorpDetails>
  </CorpDetails>
</FinalCorporationDetails>

我想根据用户分离上面的xml,并将元素转换为Table&amp; tr s

例如,对于用户ID 46,我需要输出

  <table>
<tr> <!-- needs to be inserted -->
     <td>NV20111227763</td>
     <td>645 UTAH HOLDINGS LLC</td>
     <td>04/04/2011</td>
     <td>Articles of Organization</td>
     <td>46</td> <!-- no need to print ; optional -->
 </tr><!-- needs to be inserted -->
  </table>
  <table>
  <tr> <!-- needs to be inserted -->
     <td>NV20111227763</td>
     <td>645 UTAH HOLDINGS LLC</td>
     <td>04/04/2011</td>
     <td>Initial List</td>
     <td>46</td><!-- no need to print ; optional -->
   </tr> <!-- needs to be inserted -->
  </table>

ns2:FinalCorpDetails替换为表,将所有其他元素替换为td(也需要插入tr)

0 个答案:

没有答案