Html 如何为每个select嵌套xsl:

Html 如何为每个select嵌套xsl:,html,Html,我正在尝试做一些与2009年要求的非常相似的事情-。区别在于我想再深入一层。我在获取身份证、电话号码等信息方面没有问题。我的问题是如何将会计信息转换成HTML表单。关于如何更新xslt样式表有什么建议吗?任何帮助都将不胜感激。谢谢大家! xml: <?xml version = "1.0" encoding = "UTF-8"?> <xmlString><?xml version="1.0" encoding="UTF-8"?> <resultSet x

我正在尝试做一些与2009年要求的非常相似的事情-。区别在于我想再深入一层。我在获取身份证、电话号码等信息方面没有问题。我的问题是如何将会计信息转换成HTML表单。关于如何更新xslt样式表有什么建议吗?任何帮助都将不胜感激。谢谢大家!

xml:
<?xml version = "1.0" encoding = "UTF-8"?>
<xmlString><?xml version="1.0" encoding="UTF-8"?>
<resultSet xmlns="">
    <Record>
        <ID>27184882</ID>
        <poNumber>EP40158</poNumber>
        <eventDate>Tue, 19 Nov, 2013</eventDate>
        <totalCost>400</totalCost>
      <LineItems>
            <Item>1</Item>
            <Part_Number>part456</Part_Number>
            <Unit>EA</Unit>
            <Quantity>20</Quantity>
            <Description>3rd line</Description>
            <AdditionalInfo>
                <FieldName>Print Job Title or Description</FieldName>
                <FieldValue>Test Print Test Print </FieldValue>
            </AdditionalInfo>
            <AdditionalInfo>
                <FieldName>SDN Phone</FieldName>
                <FieldValue>214-792-4312</FieldValue>
            </AdditionalInfo>
            <Accounting>
                <splitQuantity>20</splitQuantity>
                <costCenter>21000</costCenter>
                <genLedger>5600680</genLedger>
            </Accounting>
        </LineItems>
        <LineItems>
            <Item>2</Item>
            <Part_Number>part456</Part_Number>
            <Unit>EA</Unit>
            <Quantity>400</Quantity>
           <requisitionRequester>e61140</requisitionRequester>
            <AdditionalInfo>
                <FieldName>Print Job Title or Description</FieldName>
                <FieldValue>Line 2 Print Test</FieldValue>
            </AdditionalInfo>
            <Accounting>
                <splitQuantity>20</splitQuantity>
                <costCenter>21000</costCenter>
                <genLedger>5600680</genLedger>
            </Accounting>
        </LineItems>
        <LineItems>
            <Item>3</Item>
            <Part_Number>part567</Part_Number>
            <Unit>EA</Unit>
            <Quantity>35</Quantity>
            <Description>testing</Description>
            <AdditionalInfo>
                <FieldName>Print Job Title or Description</FieldName>
                <FieldValue>Testing</FieldValue>
            </AdditionalInfo>
            <AdditionalInfo>
                <FieldName>SDN Phone</FieldName>
                <FieldValue>214-792-4312</FieldValue>
            </AdditionalInfo>
            <Accounting>
                <splitQuantity>20</splitQuantity>
                <costCenter>21000</costCenter>
                <genLedger>5600680</genLedger>
            </Accounting>
        </LineItems>
    </Record>
</resultSet>
</xmlString>
以下是xslt:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
    <head>
        <title>Order <xsl:value-of select="/resultSet/Record/poNumber"></xsl:value-of></title>
    </head>
    <body>
    <font face="Arial Helvetica" size = "1">
    <p>
        <h2>Order No. <xsl:value-of select="/resultSet/Record/poNumber"/> </h2>
        Version Number: <xsl:value-of select="/resultSet/Record/Version"/><br/>
        Internal Version: false<br/>
        Issued on  <xsl:value-of select="/resultSet/Record/eventDate"/><br/>
        Created on  <xsl:value-of select="/resultSet/Record/eventDate"/><br/><br/>
    </p>
    <p>
        <table border="0" width="95%%">
        <tr valign="top">
            <td colspan="4">
                <font size="2">
                    <b>Supplier:</b><br/>
                    <xsl:value-of select="/resultSet/Record/supplierName"/><br/>
                    <xsl:value-of select="/resultSet/Record/supplierStreet"/><br/>
                    <xsl:value-of select="/resultSet/Record/supplierCity"/>, <xsl:value-of select="/resultSet/Record/supplierState"/>   
                    <xsl:value-of select="/resultSet/Record/supplierZipcode"/><br/>
                    <xsl:value-of select="/resultSet/Record/supplierCountry"/><br/>
                    Phone: 1 <br/>
                    Fax: 1 <br/>
                    Contact: <xsl:value-of select="/resultSet/Record/supplierContact"/><br/>
                </font>
            </td>
        </tr>
        </table>
    </p>
    <p>
        <table border="0" width="95%%">
        <tr valign="top">
            <td colspan="4">
                <font size="2">
                    <b>Bill To:</b><br/>
                    <xsl:value-of select="/resultSet/Record/billtoName"/><br/>
                    <xsl:value-of select="/resultSet/Record/billtoStreet"/><br/>
                    <xsl:value-of select="/resultSet/Record/billtoCity"/>, <xsl:value-of select="/resultSet/Record/billtoState"/>  <xsl:value-of select="/resultSet/Record/billtoZipcode"/><br/>
                    <xsl:value-of select="/resultSet/Record/billtoCountry"/><br/>
                    <xsl:value-of select="/resultSet/Record/billtoPhone"/><br/>
                </font>
            </td>
        </tr>
        </table>
    </p>
    <p>
        <table border="0" width="95%%">
        <tr valign="top">
            <td colspan="4">
                <font size="2">
                    <b>Ship To:</b><br/>
                    <xsl:value-of select="/resultSet/Record/shiptoName"/><br/>
                    <xsl:value-of select="/resultSet/Record/shiptoStreet"/><br/>
                    <xsl:value-of select="/resultSet/Record/shiptoCity"/>, <xsl:value-of select="/resultSet/Record/billtoState"/>    <xsl:value-of select="/resultSet/Record/shiptoZipcode"/><br/>
                    <xsl:value-of select="/resultSet/Record/shiptoCountry"/><br/>
                    <xsl:value-of select="/resultSet/Record/shiptoPhone"/><br/>
                    <br/>
                    <b>Deliver To: </b>
                    <xsl:value-of select="/resultSet/Record/deliverTo"/><br/>
                    <xsl:value-of select="/resultSet/Record/shippingAddress"/><br/>
                </font>
            </td>
        </tr>
        </table>
    </p>
    <p>
        <table border="0" width="95%%">
            <tr valign="top">
                <td>
                    <font size="2">
                        <b>Additional Information: </b>
                        <p>
                        Terms and Conditions: This purchase subject to the attached Southwest Airlines Terms and Conditions.
                        </p>
                    </font>
                </td>
            </tr>
        </table>
    </p>
    <br/>
    <br/>
    <p>
        <table border="1" width="95%%">
        <xsl:for-each select="/resultSet/Record/LineItems">
            <tr valign="top">
                <th>Item</th>
                <th>Part Number</th>
                <th>Unit</th>
                <th>Quantity</th>
                <th>Description</th>
                <th>Need By</th>
                <th>Unit Price</th>
                <th>Extended Amount</th>
            </tr>
                <td><xsl:apply-templates select="Item"/></td>
                <td><xsl:apply-templates select="Part_Number"/></td>
                <td><xsl:apply-templates select="Unit"/></td>
                <td><xsl:apply-templates select="Quantity"/></td>
                <td><xsl:apply-templates select="Description"/></td>
                <td><xsl:apply-templates select="Need_By"/></td>
                <td><xsl:apply-templates select="Unit_Price"/></td>
                <td><xsl:apply-templates select="Extended_Amount"/></td>
            <tr valign="top">
                <th>Additional Information</th>
            </tr>
                <xsl:for-each select="./AdditionalInfo">
                    <tr valign="top">
                        <th>Field Name</th>
                        <th>Field Value</th>
                    </tr>
                        <td><xsl:apply-templates select="FieldName"/></td>
                        <td><xsl:apply-templates select="FieldValue"/></td>
                </xsl:for-each>
                    <xsl:for-each select="./LineItems/Accounting">
                        <tr valign="top">
                            <td></td>
                            <td colspan="8"> <font size="2">
                                Requester: <xsl:apply-templates select="requisitionRequester"/><br/>
                                PR No.: <xsl:apply-templates select="requisitionID"/><br/>
                            </font></td>
                        </tr>
                    </xsl:for-each>
        </xsl:for-each>
    </table>
    </p>
    </font> 
    </body> 
</html>

顺序

订单号。
版本号:
内部版本:false
发布日期
创建于

供应商:


,

电话:1
传真:1
联系人:

账单收件人:





发货地点:






交付给:

其他信息: 条款和条件:本次购买以所附西南航空公司条款和条件为准。



项目 零件号 单元 量 描述 需要 单价 扩展金额 补充资料 字段名 字段值 请求者:
请购单编号:


缺少当前XSLT模板。。。。你能给我们看一下吗?在问题的帖子中添加了XSLT模板我不确定我是否理解你的意思。此for each语句:不返回任何内容,因为枚举/resultSet/Record/LineItems的每个语句都位于另一个语句中。我认为您应该将其更改为:Requester:
PR No.:
我在您的XML中没有看到任何与此匹配的内容。
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
    <head>
        <title>Order <xsl:value-of select="/resultSet/Record/poNumber"></xsl:value-of></title>
    </head>
    <body>
    <font face="Arial Helvetica" size = "1">
    <p>
        <h2>Order No. <xsl:value-of select="/resultSet/Record/poNumber"/> </h2>
        Version Number: <xsl:value-of select="/resultSet/Record/Version"/><br/>
        Internal Version: false<br/>
        Issued on  <xsl:value-of select="/resultSet/Record/eventDate"/><br/>
        Created on  <xsl:value-of select="/resultSet/Record/eventDate"/><br/><br/>
    </p>
    <p>
        <table border="0" width="95%%">
        <tr valign="top">
            <td colspan="4">
                <font size="2">
                    <b>Supplier:</b><br/>
                    <xsl:value-of select="/resultSet/Record/supplierName"/><br/>
                    <xsl:value-of select="/resultSet/Record/supplierStreet"/><br/>
                    <xsl:value-of select="/resultSet/Record/supplierCity"/>, <xsl:value-of select="/resultSet/Record/supplierState"/>   
                    <xsl:value-of select="/resultSet/Record/supplierZipcode"/><br/>
                    <xsl:value-of select="/resultSet/Record/supplierCountry"/><br/>
                    Phone: 1 <br/>
                    Fax: 1 <br/>
                    Contact: <xsl:value-of select="/resultSet/Record/supplierContact"/><br/>
                </font>
            </td>
        </tr>
        </table>
    </p>
    <p>
        <table border="0" width="95%%">
        <tr valign="top">
            <td colspan="4">
                <font size="2">
                    <b>Bill To:</b><br/>
                    <xsl:value-of select="/resultSet/Record/billtoName"/><br/>
                    <xsl:value-of select="/resultSet/Record/billtoStreet"/><br/>
                    <xsl:value-of select="/resultSet/Record/billtoCity"/>, <xsl:value-of select="/resultSet/Record/billtoState"/>  <xsl:value-of select="/resultSet/Record/billtoZipcode"/><br/>
                    <xsl:value-of select="/resultSet/Record/billtoCountry"/><br/>
                    <xsl:value-of select="/resultSet/Record/billtoPhone"/><br/>
                </font>
            </td>
        </tr>
        </table>
    </p>
    <p>
        <table border="0" width="95%%">
        <tr valign="top">
            <td colspan="4">
                <font size="2">
                    <b>Ship To:</b><br/>
                    <xsl:value-of select="/resultSet/Record/shiptoName"/><br/>
                    <xsl:value-of select="/resultSet/Record/shiptoStreet"/><br/>
                    <xsl:value-of select="/resultSet/Record/shiptoCity"/>, <xsl:value-of select="/resultSet/Record/billtoState"/>    <xsl:value-of select="/resultSet/Record/shiptoZipcode"/><br/>
                    <xsl:value-of select="/resultSet/Record/shiptoCountry"/><br/>
                    <xsl:value-of select="/resultSet/Record/shiptoPhone"/><br/>
                    <br/>
                    <b>Deliver To: </b>
                    <xsl:value-of select="/resultSet/Record/deliverTo"/><br/>
                    <xsl:value-of select="/resultSet/Record/shippingAddress"/><br/>
                </font>
            </td>
        </tr>
        </table>
    </p>
    <p>
        <table border="0" width="95%%">
            <tr valign="top">
                <td>
                    <font size="2">
                        <b>Additional Information: </b>
                        <p>
                        Terms and Conditions: This purchase subject to the attached Southwest Airlines Terms and Conditions.
                        </p>
                    </font>
                </td>
            </tr>
        </table>
    </p>
    <br/>
    <br/>
    <p>
        <table border="1" width="95%%">
        <xsl:for-each select="/resultSet/Record/LineItems">
            <tr valign="top">
                <th>Item</th>
                <th>Part Number</th>
                <th>Unit</th>
                <th>Quantity</th>
                <th>Description</th>
                <th>Need By</th>
                <th>Unit Price</th>
                <th>Extended Amount</th>
            </tr>
                <td><xsl:apply-templates select="Item"/></td>
                <td><xsl:apply-templates select="Part_Number"/></td>
                <td><xsl:apply-templates select="Unit"/></td>
                <td><xsl:apply-templates select="Quantity"/></td>
                <td><xsl:apply-templates select="Description"/></td>
                <td><xsl:apply-templates select="Need_By"/></td>
                <td><xsl:apply-templates select="Unit_Price"/></td>
                <td><xsl:apply-templates select="Extended_Amount"/></td>
            <tr valign="top">
                <th>Additional Information</th>
            </tr>
                <xsl:for-each select="./AdditionalInfo">
                    <tr valign="top">
                        <th>Field Name</th>
                        <th>Field Value</th>
                    </tr>
                        <td><xsl:apply-templates select="FieldName"/></td>
                        <td><xsl:apply-templates select="FieldValue"/></td>
                </xsl:for-each>
                    <xsl:for-each select="./LineItems/Accounting">
                        <tr valign="top">
                            <td></td>
                            <td colspan="8"> <font size="2">
                                Requester: <xsl:apply-templates select="requisitionRequester"/><br/>
                                PR No.: <xsl:apply-templates select="requisitionID"/><br/>
                            </font></td>
                        </tr>
                    </xsl:for-each>
        </xsl:for-each>
    </table>
    </p>
    </font> 
    </body> 
</html>