HTML 代码在尝试验证时获取列的错误消息

问题描述 投票:0回答:1

我完全不明白为什么我的代码无法验证。每次我尝试时,都会收到以下错误:“模板中第 257 行第 5 列出错。 详细...”

我希望这里有人可以帮助我,因为我只知道编码的基础知识。这确实超出了我的范围。

下面代码中的第 257 行是“”——没有“列”。那么为什么说“列”有问题,我该如何修复它?

提前谢谢您!

这是我们的代码:

<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
<head>
    <link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
    <#if .locale == "zh_CN">
    <link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
    <#elseif .locale == "zh_TW">
    <link name="NotoSansCJKtc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKtc_Regular}" src-bold="${nsfont.NotoSansCJKtc_Bold}" bytes="2" />
    <#elseif .locale == "ja_JP">
    <link name="NotoSansCJKjp" type="font" subtype="opentype" src="${nsfont.NotoSansCJKjp_Regular}" src-bold="${nsfont.NotoSansCJKjp_Bold}" bytes="2" />
    <#elseif .locale == "ko_KR">
    <link name="NotoSansCJKkr" type="font" subtype="opentype" src="${nsfont.NotoSansCJKkr_Regular}" src-bold="${nsfont.NotoSansCJKkr_Bold}" bytes="2" />
    <#elseif .locale == "th_TH">
    <link name="NotoSansThai" type="font" subtype="opentype" src="${nsfont.NotoSansThai_Regular}" src-bold="${nsfont.NotoSansThai_Bold}" bytes="2" />
    </#if>
    <macrolist>
        `your text`
        <macro id="nlheader">
            <table class="header" style="width: 100%;">
                <tr>
                    <td rowspan="9">
                        <#if companyInformation.logoUrl?length != 0><img src="${companyInformation.logoUrl}" style="float: left; margin: 7px; height: 80%; width: 80%" /> </#if>
                        <p>
                            <barcode codetype="code128" showtext="true" value="${record.tranid}"/>
                        </p>
                    </td>
                    <td style="width: 308px;"><span class="title" style="font-size: 20pt;"> <strong>PICKING TICKET</strong></span></td>
                </tr>
                <tr>
                    <td align="Left" style="width: 308px;"><span class="number"><strong>Order #:</strong> #${record.tranid}</span></td>
                </tr>
                <tr>
                    <td align="Left" style="font-size: 9pt; width: 308px; margin-top: 10px;"><strong>Order Date:  </strong> ${record.trandate}<br /><strong>Customer #:</strong> ${record.custbody7}<br /><strong>PO #:</strong> ${record.otherrefnum}<br /><strong>Sales Rep:</strong> ${record.salesrep}<br /><strong>Terms:  </strong> ${record.terms}<br /><strong>Pmt Method:</strong> ${record.paymentmethod}<br /><strong>Delivery Phone:</strong> ${record.custbody10}</td>
                </tr>
            </table>
        </macro>
        <macro id="nlfooter">
            <table class="footer" style="width: 100%;">
                <tr>
                    <td align="center" style="width: 500px;">
                        <pagenumber/>
                        of 
                        <totalpages/>
                    </td>
                    <td align="right" style="font-size:4px; width: 50px;">WP Picking Ticket ADV</td>
                </tr>
            </table>
        </macro>
    </macrolist>
    <style type="text/css">* {
        <#if .locale == "zh_CN">
        font-family: NotoSans, NotoSansCJKsc, sans-serif;
        <#elseif .locale == "zh_TW">
        font-family: NotoSans, NotoSansCJKtc, sans-serif;
        <#elseif .locale == "ja_JP">
        font-family: NotoSans, NotoSansCJKjp, sans-serif;
        <#elseif .locale == "ko_KR">
        font-family: NotoSans, NotoSansCJKkr, sans-serif;
        <#elseif .locale == "th_TH">
        font-family: NotoSans, NotoSansThai, sans-serif;
        <#else>
        font-family: NotoSans, sans-serif;
        </#if>
        }
        table {
        font-size: 9pt;
        table-layout: fixed;
        }
        th {
        font-weight: bold;
        font-size: 9pt;
        vertical-align: middle;
        padding: 5px 6px 3px;
        background-color: #d8d8d8;
        color: #333333;
        }
        td {
        padding: 4px 6px;
        }
        td p { align:left }
        b {
        font-weight: bold;
        color: #333333;
        }
        table.header td {
        padding: 0;
        font-size: 10pt;
        }
        table.footer td {
        padding: 0;
        font-size: 8pt;
        }
        table.itemtable th {
        padding-bottom: 10px;
        padding-top: 10px;
        }
        table.body td {
        padding-top: 2px;
        }
        td.addressheader {
        font-size: 8pt;
        font-weight: bold;
        padding-top: 6px;
        padding-bottom: 2px;
        }
        td.address {
        padding-top: 0;
        }
        span.title {
        font-size: 28pt;
        }
        span.number {
        font-size: 16pt;
        }
        span.itemname {
        font-weight: bold;
        line-height: 150%;
        }
        hr {
        width: 100%;
        color: #d3d3d3;
        background-color: #d3d3d3;
        height: 1px;
        }
    </style>
</head>
<body header="nlheader" header-height="16%" footer="nlfooter" footer-height="20pt" padding="0.5in 0.5in 0.5in 0.5in" size="Letter">
    <table style="width: 100%; margin-top: 10px;">
        <tr>
            <td class="addressheader" style="font-size: 12pt;"><b>${record.billaddress@label}</b></td>
            <td class="addressheader" style="font-size: 12pt;"><b>${record.shipaddress@label}</b></td>
        </tr>
        <tr>
            <td class="address" style="font-size: 10pt;">${record.billaddress}</td>
            <td class="address" style="font-size: 10pt;">${record.shipaddress}</td>
        </tr>
    </table>
    <table class="body" style="width: 100%; margin-top: 10px;">
        <tr>
            <th colspan="2">Ship Via</th>
            <th>Shipper #</th>
            <th>Ship Date</th>
        </tr>
        <tr>
            <td colspan="2">${record.shipmethod}</td>
            <!-- *************************************Shipping account logic below**********************************************************************--><#if record.shipmethod?contains ("Bill Receiver")><#if record.shipmethod?contains ("UPS")>
            <td>UPS: ${record.custbody14}</td>
            <#else>
            <td>Fedex: ${record.custbody15}</td>
            </#if><#elseif record.shipmethod?contains ("3rd Party")><#if record.shipmethod?contains ("UPS")>
            <td>UPS: ${record.custbody14}</td>
            <#else>
            <td>Fedex: ${record.custbody15}</td>
            </#if><#elseif record.shipmethod?contains ("Collect")><#if record.shipmethod?contains ("UPS")>
            <td>UPS: ${record.custbody14}</td>
            <#else>
            <td>Fedex: ${record.custbody15}</td>
            </#if><#else>
            <td>&nbsp;</td>
            </#if>
            <td>${record.shipdate}</td>
        </tr>
    </table>
    <table class="body" style="width: 100%; margin-top: 10px;">
        <tr>
            <th>Note to WP Warehouse</th>
        </tr>
        <tr>
            <td>${record.Custbody18}</td>
        </tr>
    </table>
    <!-- *************************************Item table below**********************************************************************--><#if record.item?has_content>
    <table class="itemtable" style="width: 100%; margin-top: 10px;">
        <!-- start items -->
        <#list record.item as item>
        <#if item_index==0>
        <thead>
            <tr>
                <th colspan="4">${item.item@label}</th>
                <th>Shelf</th>
                <th>Ordered</th>
                <th>To Ship</th>
                <th>B/O</th>
                <th>Shipped</th>
            </tr>
        </thead>
        </#if>
        <#if (item.quantitycommitted?string == '0')>
        <#elseif item.itemtype == 'OthCharge'><!--  If none comitted or itemtype is other charge then print nothing, else print whats below-->
        <#else>
        <tr>
            <td colspan="4"><span class="itemname">${item.item}</span><br />${item.description}</td>
            <td>${item.custcol2}</td>
            <td>${item.quantity}</td>
            <td>${item.quantitycommitted}</td>
            <td>${item.quantitybackordered}</td>
            <td>_____</td>
        </tr>
        <!--    </#if> -->
        </#list>
    </table>
    <!-- *************************************Items BackOrdered**********************************************************************-->
    <hr />
    <table class="itemtable" style="width:100%; margin-top:20px;">
        <tr>
            <td align="left" style="font-size:13pt;"><strong>BACKORDERED ITEM(S):</strong></td>
        </tr>
        <tr>
            <td align="left" style="font-size:8pt;"><em>Excludes partial backorder items.</em></td>
        </tr>
    </table>
    <table class="itemtable2" style="width: 100%; margin-top: 0px;">
        <thead>
            <tr>
                <th colspan="12">Item</th>
                <!--    <th colspan="3">${salesorder.item[0].options@label}</th> -->
                <th align="right" colspan="4">${salesorder.item[0].quantityordered@label}</th>
                <th align="right" colspan="4">Shipped</th>
                <th align="right" colspan="4">${salesorder.item[0].quantityremaining@label}</th>
                <th align="right" colspan="4">Unit</th>
            </tr>
        </thead>
        <#list salesorder.item as tranline>
        <#if tranline.quantityremaining?has_content && tranline.quantity?string = ''>
        <tr>
            <td colspan="12"><span class="itemname">${tranline.item}</span><br />${tranline.description}</td>
            <!--    <td colspan="3">${tranline.options}</td> -->
            <td align="right" colspan="4">${tranline.quantityordered}</td>
            <td align="right" colspan="4">${tranline.quantity}</td>
            <td align="right" colspan="4">${tranline.quantityremaining}</td>
            <td align="right" colspan="4">${tranline.custcol5}</td>
        </tr>
        </#if>
        </#list>
    </table>
    <!--********************************************************************End Item Lists*******************************************************--><!--********************************************************************End Item Lists*******************************************************-->
    </#if>
    <#if preferences.RETURNFORM && returnForm??>
    <hr />
    <div class="returnform" visibility="hidden">
        <table style="width: 100%; margin-top: 10px;">
            <tr>
                <td><span class="nameandaddress">${companyInformation.companyName}</span></td>
                <td align="right"><span class="number">${returnForm@title}</span></td>
            </tr>
        </table>
        <table style="width: 100%; margin-top: 10px;" visibility="hidden">
            <tr>
                <td class="addressheader" colspan="4">${returnForm.returnAddress}</td>
                <th>${returnForm.rmaNum}</th>
                <th colspan="2">${returnForm.customerName}</th>
                <th>${salesorder.tranid@label}</th>
            </tr>
            <tr>
                <td class="address" colspan="4" rowspan="2">&nbsp;</td>
                <td>&nbsp;</td>
                <td colspan="2">${salesorder.entity}</td>
                <td>${salesorder.tranid}</td>
            </tr>
            <tr>
                <td colspan="4">&nbsp;</td>
            </tr>
        </table>
        <table class="itemtable" style="width: 100%; margin-top: 10px;" visibility="hidden">
            <thead>
                <tr>
                    <th colspan="2">${returnForm.item}</th>
                    <th colspan="1">${returnForm.quantity}</th>
                    <th colspan="5">${returnForm.reason}</th>
                </tr>
            </thead>
            <tr>
                <td colspan="8">&nbsp;</td>
            </tr>
        </table>
    </div>
    </#if>
    </#list>
    </table>
    </#if>
    </#if>
    </#elseif>
    </#if>
    </#if>
    </tr>
    </table>
</body>
</#elseif>
</#elseif>
</#if>
</head>
</pdf>

我什至不知道从哪里开始解决这个问题,因为我不明白为什么它在第 257 行不存在“列”的情况下谈论“列”。就像我说的,我只知道编码的基础知识所以请尝试使用外行术语。

html validation netsuite
1个回答
0
投票

首先,相应地格式化你的缩进

你的缩进到处都是。如果您无法通过查看一个标签的开始和结束位置来判断,您将如何直观地验证每个开始标签都有一个结束标签?

原代码:

<!-- start items -->
        <#list record.item as item>
        <#if item_index==0>
        <thead>
            <tr>
                <th colspan="4">${item.item@label}</th>
                <th>Shelf</th>
                <th>Ordered</th>
                <th>To Ship</th>
                <th>B/O</th>
                <th>Shipped</th>
            </tr>
        </thead>
        </#if>
        <#if (item.quantitycommitted?string == '0')>
        <#elseif item.itemtype == 'OthCharge'><!--  If none comitted or itemtype is other charge then print nothing, else print whats below-->
        <#else>
        <tr>
            <td colspan="4"><span class="itemname">${item.item}</span><br />${item.description}</td>
            <td>${item.custcol2}</td>
            <td>${item.quantity}</td>
            <td>${item.quantitycommitted}</td>
            <td>${item.quantitybackordered}</td>
            <td>_____</td>
        </tr>
        <!--    </#if> -->
        </#list>

缩进:

<!-- start items -->
<#list record.item as item>
    <#if item_index==0>
        <thead>
            <tr>
                <th colspan="4">${item.item@label}</th>
                <th>Shelf</th>
                <th>Ordered</th>
                <th>To Ship</th>
                <th>B/O</th>
                <th>Shipped</th>
            </tr>
        </thead>
    </#if>
    <#if (item.quantitycommitted?string == '0')>
        <#elseif item.itemtype == 'OthCharge'><!--  If none comitted or itemtype is other charge then print nothing, else print whats below-->
        <#else>
        <tr>
        <td colspan="4"><span class="itemname">${item.item}</span><br />${item.description}</td>
        <td>${item.custcol2}</td>
        <td>${item.quantity}</td>
        <td>${item.quantitycommitted}</td>
        <td>${item.quantitybackordered}</td>
        <td>_____</td>
        </tr>
    <!--    </#if> -->
</#list>

缩进将允许您验证您是否拥有所有开始和结束标签,并且没有任何内容是孤立的。


解决方案:我将进行大胆猜测,并说您需要取消注释 if 语句的结束标记。

        </tr>
    </#if>
</#list>
© www.soinside.com 2019 - 2024. All rights reserved.