如何在不知道节点

时间:2016-06-13 12:29:42

标签: xml xslt

我想请求您帮助创建一个通用的XSLT代码,该代码将在不知道节点的情况下生成制表符分隔的输出,以便此XSLT代码可以重复使用。

XML输入:



<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <InvoiceInformation xmlns="data.Invoice">
         <InvoiceHeaders>
            <InvoiceID>3</InvoiceID>
            <InvoiceSource>INVOICEFIRM</InvoiceSource>
            <InvoiceNumber>jimt_1235</InvoiceNumber>
            <InvoiceDate>2016-05-25</InvoiceDate>
            <InvoiceAmount>100.00</InvoiceAmount>
            <InvoiceCurrency>USD</InvoiceCurrency>
            <InvoiceType>STANDARD</InvoiceType>
            <LiabilityCoASegments />
            <BusinessUnit>US OBU</BusinessUnit>
            <SupplierNumber>10002</SupplierNumber>
            <SupplierSite>Chicago IL</SupplierSite>
            <PaymentCurrency>USD</PaymentCurrency>
            <PaymentTerm>CHECK</PaymentTerm>
            <Attribute1>DB5 031816INC</Attribute1>
            <Attribute2>0000000057295</Attribute2>
            <FileId>6F9619FF-8B86-D011-B42D-00C04FC964FF</FileId>
            <IsImportComplete>true</IsImportComplete>
            <IsCoASegNotFound>false</IsCoASegNotFound>
            <InvoiceDetails>
               <InvoiceDetails>
                  <LineNumber>1</LineNumber>
                  <LineDescription>IL/0000000057295</LineDescription>
                  <LineType>ITEM</LineType>
                  <LineAmount>100.00</LineAmount>
                  <DistributionCoASegments>1005-105-70250-8280-0531-00000-1005-00000-00000</DistributionCoASegments>
                  <Attribute2 />
                  <IsCoASegNotFound>false</IsCoASegNotFound>
                  <Payment>
                  	<Paymentmode>
                  		<Cash>N</Cash>
                  		<Eft>N</Eft>
                  		<Check>Y</Check>
                  		     <CheckInfo>
                  		     			<CheckNumber>1111999</CheckNumber>
                  		     </CheckInfo>
                  	</Paymentmode>	
                  </Payment>
               </InvoiceDetails>
               <InvoiceDetails>
                  <LineNumber>2</LineNumber>
                  <LineDescription>IL/0000000057296</LineDescription>
                  <LineType>ITEM</LineType>
                  <LineAmount>100.00</LineAmount>
                  <DistributionCoASegments>1005-105-70250-8280-0531-00000-1005-00000-00000</DistributionCoASegments>
                  <Attribute2 />
                  <IsCoASegNotFound>false</IsCoASegNotFound>
                  <Payment>
                  	<Paymentmode>
                  		<Cash>N</Cash>
                  		<Eft>N</Eft>
                  		<Check>Y</Check>
                  		     <CheckInfo>
                  		     			<CheckNumber>2222888</CheckNumber>
                  		     </CheckInfo>
                  	</Paymentmode>	
                  </Payment>
               </InvoiceDetails>
            </InvoiceDetails>
         </InvoiceHeaders>
      </InvoiceInformation>
   </soapenv:Body>
</soapenv:Envelope>
&#13;
&#13;
&#13;

期望输出:

3   INVOICEFIRM jimt_1235   2016-05-25  100.00  USD STANDARD        US OBU  10002   Chicago IL  USD CHECK   031816INC   0000000057295   6F9619FF-8B86-D011-B42D-00C04FC964FF    true    false
1   IL/0000000057295    ITEM    100.00  1005-105-70250-8280-0531-00000-1005-00000-00000     false
N   N   Y
1111999
2   IL/0000000057296    ITEM    100.00  1005-105-70250-8280-0531-00000-1005-00000-00000     false
N   N   Y
2222888

0 个答案:

没有答案