2014-02-10 43 views
0

我們有在XSL中創建的新聞簡報,這允許編輯者標記文章,然後自動生成新聞簡報。這是一個相對強大的系統。在XSL中爲簡報收一個簡單表格

我是新來的XSL和我在努力讓通訊在Outlook中正確顯示(它出現100%的罰款在Web瀏覽器,但我敢肯定我知道爲什麼問題發生。

我明白各種填充問題簡報,但我發現很難關閉表 - 是一個簡單的表,我真的不知道,如果有人能幫助我解決這一點,但在這裏我們去:

我強調唯一有問題的代碼。 。在大膽的部分末尾添加</table>就不會編譯 - 它迫使我關閉</xsl:template></xsl:stylesheet>。這意味着斜體代碼de的模式是「頂級故事」,但這隻發生在電子郵件客戶端而不是瀏覽器。

完整的代碼太長,張貼在這裏(939線長),所以我創建了一個簡化版本(hopfully有沒有太多的語法錯誤)

<?xml version="1.0" encoding="iso-8859-1"?> 
<!DOCTYPE xsl:stylesheet [ 
    <!ENTITY nbsp "&#160;"> 
    <!ENTITY copy "&#169;"> 
    <!ENTITY reg "&#174;"> 
    <!ENTITY trade "&#8482;"> 
    <!ENTITY mdash "&#8212;"> 
    <!ENTITY ldquo "&#8220;"> 
    <!ENTITY rdquo "&#8221;"> 
    <!ENTITY pound "&#163;"> 
    <!ENTITY yen "&#165;"> 
    <!ENTITY euro "&#8364;"> 
]> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    <xsl:output method="html" encoding="iso-8859-1"/> 

    <!-- Load Utilities XSL --> 
    <xsl:include href = "$xslPath/x156.xsl"/> 


    <xsl:template match="/"> 

    <xsl:choose> 
     <xsl:when test="search-results/size &gt; 0"> 
     <xsl:apply-templates select="search-results/items" /> 
     </xsl:when> 
     <xsl:otherwise> 
     <p>There are no articles linked to this newsletter.</p> 
     </xsl:otherwise> 
    </xsl:choose> 
    </xsl:template> 

    <xsl:template match="items"> 

    <xsl:variable name="prem1_img"> 
     <xsl:value-of select="document('http://www.khl-banner.com/email/world-demolition.asp')/banners/wd/banner[@slot='prem-1']/image"/> 
    </xsl:variable> 
    <xsl:variable name="prem1_link"> 
     <xsl:value-of select="document('http://www.khl-banner.com/email/world-demolition.asp')/banners/wd/banner[@slot='prem-1']/link"/> 
    </xsl:variable> 

    <xsl:variable name="prem2_img"> 
     <xsl:value-of select="document('http://www.khl-banner.com/email/world-demolition.asp')/banners/wd/banner[@slot='prem-2']/image"/> 
    </xsl:variable> 
    <xsl:variable name="prem2_link"> 
     <xsl:value-of select="document('http://www.khl-banner.com/email/world-demolition.asp')/banners/wd/banner[@slot='prem-2']/link"/> 
    </xsl:variable> 

    <xsl:variable name="prem3_img"> 
     <xsl:value-of select="document('http://www.khl-banner.com/email/world-demolition.asp')/banners/wd/banner[@slot='prem-3']/image"/> 
    </xsl:variable> 
    <xsl:variable name="prem3_link"> 
     <xsl:value-of select="document('http://www.khl-banner.com/email/world-demolition.asp')/banners/wd/banner[@slot='prem-3']/link"/> 
    </xsl:variable> 

    <table width="770" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#BD2125"> 
     <tr> 
     <td width="10"> 
      <img src="http://www.khl.com/other_files/newsletters/WD-new/spacer-red.gif" alt="" width="10" height="20" /> 
     </td> 

     <td height="25" valign="middle" class="heading">TOP STORY »</td> 
     </tr> 
    </table> 

    <br></br> 

    **<table width="770"> 


     <xsl:if test="data-item/item-links/item-link[@id=641]/items/item/@id=$current_item_id"> 
     <tr> 
      <xsl:apply-templates select="data-item[item-links/item-link[@id=641]/items/item/@id=$current_item_id]" mode="top-story"/> 
     </tr> 
     </xsl:if>** 






     *<table width="760" height="40" border="0" cellpadding="0" cellspacing="0" bgcolor="#111D25"> 
     <br></br> 
     <tbody> 
      <tr> 
      <td width="10"> 
       <img src="http://www.khl.com/other_files/newsletters/WD-new/spacer-111d25.gif"/> 
      </td> 
      <td height="40" valign="middle" class="heading">DEMOLITION AND RECYCLING INTERNATIONAL NEWSLETTER »</td> 
      <td width="40" align="center" valign="middle" bgcolor="#36609F" class="heading"> 
       <a href="https://en-gb.facebook.com/KHLGroup%E2%80%8E"></a> 
       <a href="https://www.facebook.com/DemolitionandRecyclingInternational?ref=hl"> 
       <img src="http://www.khl.com/other_files/newsletters/WD-new/social-icon-facebook.gif"/> 
       </a> 
       <a href="http://www.facebook.com/pages/Demolition-Recycling-International/129306127144056"></a> 
      </td> 
      <td width="10" valign="middle" class="heading">&nbsp;</td> 
      <td width="40" align="center" valign="middle" bgcolor="#2CAAE1" class="heading"> 
       <a href="https://twitter.com/KHLConstruction%E2%80%8E"></a> 
       <a href="http://www.twitter.com/KHL_DRI"> 
       <img src="http://www.khl.com/other_files/newsletters/WD-new/social-icon-twitter.gif"/> 
       </a> 
       <a href="http://www.twitter.com/KHL_DRI"></a> 
      </td> 
      <td width="10" valign="middle" class="heading">&nbsp;</td> 
      <td width="40" align="center" valign="middle" bgcolor="#0A6C9B" class="heading"> 
       <a href="http://www.linkedin.com/company/khl-group%E2%80%8E"></a> 
       <a href="http://www.linkedin.com/groups?gid=3546771&amp;trk=my_groups-b-grp-v"> 
       <img src="http://www.khl.com/other_files/newsletters/WD-new/social-icon-linkedin.gif"/> 
       </a> 
       <a href="http://www.linkedin.com/groups/World-Demolition-Summit-2011-3983919?trk=myg_ugrp_ovr"></a> 
      </td> 
      <td width="10" valign="middle" class="heading">&nbsp;</td> 
      <td width="40" align="center" valign="middle" bgcolor="#EE3537" class="heading"> 
       <a href="http://www.youtube.com/khlgroup"> 
       <img src="http://www.khl.com/other_files/newsletters/WD-new/social-icon-youtube.gif"/> 
       </a> 
       <a href="http://www.youtube.com/user/KHLGroup/videos?view=1"></a> 
      </td> 
      <td width="10" valign="middle" class="heading">&nbsp;</td> 
      <td width="40" align="center" valign="middle" bgcolor="#F58020" class="heading"> 
       <a href="http://www.khl.com/feeds"> 
       <img src="http://www.khl.com/other_files/newsletters/WD-new/social-icon-rss.gif"/> 
       </a> 
      </td> 
      <td width="10" valign="middle" class="heading">&nbsp;</td> 
      </tr> 
     </tbody> 
     </table>* 



     <table width="70" height="10" border="0" cellpadding="0" cellspacing="0"> 

     <br></br> 
     <tbody> 
      <tr> 
      <td bgcolor="#666666" width="80" style="font-size: 11px; line-height: 18px; font-family: Arial,Tahoma, Helvetica, sans-serif; color:#bc2024; font-weight:bold; text-align:center;" title="textColor"> 
       <span title="textColor" style="text-decoration: none; color: #FFFFFF;">&nbsp;&nbsp;SPONSOR&nbsp;&nbsp;</span> 
      </td> 
      </tr> 



      <xsl:if test="$prem1_img != ''"> 
      <tr> 
       <td colspan="2"> 
       <table cellspacing="0" cellpadding="0" border="0" width="764"> 
        <tbody> 
        <tr> 
         <td colspan="2" height="50" align="center"> 
         <!--img height="30" width="760" src="http://www.khl.com/other_files/newsletters/world-demolition/wd-sponsor.gif" /><br /--> 
         <a href="{$prem1_link}"> 
          <img border="0" src="{$prem1_img}" /> 
         </a> 
         <br /> 
         </td> 
        </tr> 
        </tbody> 
       </table> 
       </td> 
      </tr> 
      </xsl:if> 


     </tbody> 
     </table> 


     <table width="770" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#111D25"> 
     <br></br> 
     <tr> 
      <td width="10"> 
      <img src="http://www.khl.com/other_files/newsletters/WD-new/spacer-111d25.gif" alt="" width="10" height="20" /> 
      </td> 

      <td height="25" valign="middle" class="heading">DEMOLITION NEWS »</td> 
     </tr> 
     </table> 


     --> 

     <xsl:if test="$prem3_img != ''"> 
     <tr> 
      <td colspan="2"> 
      <table cellspacing="0" cellpadding="0" border="0" width="764"> 
       <tbody> 
       <tr> 
        <td colspan="2" height="120" align="center"> 
        <!--img height="30" width="760" src="http://www.khl.com/other_files/newsletters/world-demolition/wd-sponsor.gif" /><br /--> 
        <a href="{$prem3_link}"> 
         <img border="0" src="{$prem3_img}" /> 
        </a> 
        <br /> 
        </td> 
       </tr> 
       </tbody> 
      </table> 
      </td> 
     </tr> 
     </xsl:if> 

    </table> 
    </xsl:template> 

    <xsl:template match="data-item" mode="access-news"> 

    <xsl:variable name="title"> 
     <xsl:call-template name="replaceTitle"> 
     <xsl:with-param name="title" select="content/item/title"/> 
     </xsl:call-template> 
    </xsl:variable> 

    <xsl:variable name="path"> 
     <xsl:call-template name="detail_path"> 
     <xsl:with-param name="item" select="current()"/> 
     </xsl:call-template> 
    </xsl:variable> 

    <td width="110" valign="top" class="tumbImage"> 
     <a href="http://www.khl.com{$path}/{link}{$title}?nltr=rw"> 
     <xsl:choose> 
      <xsl:when test="item-links/item-link[@id=466]/items/item[1]"> 
      <img border="0" width="110" height="80" src="http://www.khl.com{item-links/item-link[@id=466]/items/item/derived-files/preview}"/> 
      </xsl:when> 
      <xsl:otherwise> 
      <img border="0" width="110" height="80" src="http://www.khl.com{item-links/item-link[@id=2]/items/item/derived-files/preview}"/> 
      </xsl:otherwise> 
     </xsl:choose> 
     </a> 
    </td> 
    <td width="285" valign="top"> 
     <a class="headLineLink2" href="http://www.khl.com{$path}/{link}{$title}?nltr=rw"> 
     <strong> 
      <xsl:value-of select="name" /> 
     </strong> 
     </a> 
     <br /> 
     <br /> 
     <xsl:value-of select="substring(content/item/standfirst,0,120)" disable-output-escaping="yes"/> 
     <xsl:text>...</xsl:text> 
    </td> 

    </xsl:template> 


    <xsl:template match="data-item" mode="access-news2"> 

    <xsl:variable name="title"> 
     <xsl:call-template name="replaceTitle"> 
     <xsl:with-param name="title" select="content/item/title"/> 
     </xsl:call-template> 
    </xsl:variable> 
    <xsl:variable name="path"> 
     <xsl:call-template name="detail_path"> 
     <xsl:with-param name="item" select="current()"/> 
     </xsl:call-template> 
    </xsl:variable> 


    <td width="110" valign="top" class="tumbImage"> 
     <a href="http://www.khl.com{$path}/{link}{$title}?nltr=rw"> 
     <xsl:choose> 
      <xsl:when test="item-links/item-link[@id=466]/items/item[1]"> 
      <img border="0" width="110" height="80" src="http://www.khl.com{item-links/item-link[@id=466]/items/item/derived-files/preview}"/> 
      </xsl:when> 
      <xsl:otherwise> 
      <img border="0" width="110" height="80" src="http://www.khl.com{item-links/item-link[@id=2]/items/item/derived-files/preview}"/> 
      </xsl:otherwise> 
     </xsl:choose> 
     </a> 
    </td> 
    <td width="300" valign="top"> 
     <a class="headLineLink2" href="http://www.khl.com{$path}/{link}{$title}?nltr=rw"> 
     <strong> 
      <xsl:value-of select="name" /> 
     </strong> 
     </a> 
     <br /> 
     <br /> 
     <xsl:value-of select="substring(content/item/standfirst,0,282)" disable-output-escaping="yes"/> 
     <xsl:text>...</xsl:text> 
    </td> 

    </xsl:template> 

    <xsl:template match="data-item" mode="access-news3"> 

    <xsl:variable name="title"> 
     <xsl:call-template name="replaceTitle"> 
     <xsl:with-param name="title" select="content/item/title"/> 
     </xsl:call-template> 
    </xsl:variable> 

    <xsl:variable name="path"> 
     <xsl:call-template name="detail_path"> 
     <xsl:with-param name="item" select="current()"/> 
     </xsl:call-template> 
    </xsl:variable> 
    <tr> 
     <td width="250"> 
     <a class="headLineLink2" href="http://www.khl.com{$path}/{link}{$title}?nltr=rw"> 
      <strong> 
      <xsl:value-of select="name" /> 
      </strong> 
     </a> 
     </td> 
    </tr> 

    <td width="110" valign="top" class="tumbImage"> 
     <a href="http://www.khl.com{$path}/{link}{$title}?nltr=rw"> 
     <xsl:choose> 
      <xsl:when test="item-links/item-link[@id=466]/items/item[1]"> 
      <img border="0" width="110" height="80" align="left" src="http://www.khl.com{item-links/item-link[@id=466]/items/item/derived-files/preview}"/> 
      </xsl:when> 
      <xsl:otherwise> 
      <img border="0" width="110" height="80" align="left" src="http://www.khl.com{item-links/item-link[@id=2]/items/item/derived-files/preview}"/> 
      <img src="http://www.khl.com/other_files/newsletters/spacer-new.gif" width="10" height="110" align="left"></img> 
      </xsl:otherwise> 
     </xsl:choose> 
     </a> 
     <xsl:value-of select="substring(content/item/standfirst,0,120)" disable-output-escaping="yes"/> 
     <xsl:text>...</xsl:text> 
    </td> 


    </xsl:template> 

    <xsl:template match="data-item" mode="access-newsQ"> 


    <xsl:variable name="title"> 
     <xsl:call-template name="replaceTitle"> 
     <xsl:with-param name="title" select="content/item/title"/> 
     </xsl:call-template> 
    </xsl:variable> 

    <xsl:variable name="path"> 
     <xsl:call-template name="detail_path"> 
     <xsl:with-param name="item" select="current()"/> 
     </xsl:call-template> 
    </xsl:variable> 
    <tr> 
     <td width="250"> 
     <a class="headLineLink2" href="http://www.khl.com{$path}/{link}{$title}?nltr=rw"> 
      <strong> 
      <xsl:value-of select="name" /> 
      </strong> 
     </a> 
     </td> 
    </tr> 

    <td width="110" valign="top" class="tumbImage"> 
     <a href="http://www.khl.com{$path}/{link}{$title}?nltr=rw"> 
     <xsl:choose> 
      <xsl:when test="item-links/item-link[@id=466]/items/item[1]"> 
      <img border="0" width="110" height="80" align="left" src="http://www.khl.com{item-links/item-link[@id=466]/items/item/derived-files/preview}"/> 
      </xsl:when> 
      <xsl:otherwise> 
      <img border="0" width="110" height="80" align="left" src="http://www.khl.com{item-links/item-link[@id=2]/items/item/derived-files/preview}"/> 
      <img src="http://www.khl.com/other_files/newsletters/spacer-new.gif" width="10" height="110" align="left"></img> 
      </xsl:otherwise> 
     </xsl:choose> 
     </a> 
     <xsl:value-of select="substring(content/item/standfirst,0,120)" disable-output-escaping="yes"/> 
     <xsl:text>...</xsl:text> 
    </td> 


    </xsl:template> 


    <xsl:template match="data-item" mode="access-newsN"> 

    <xsl:variable name="title"> 
     <xsl:call-template name="replaceTitle"> 
     <xsl:with-param name="title" select="content/item/title"/> 
     </xsl:call-template> 
    </xsl:variable> 

    <xsl:variable name="path"> 
     <xsl:call-template name="detail_path"> 
     <xsl:with-param name="item" select="current()"/> 
     </xsl:call-template> 
    </xsl:variable> 
    <tr> 
     <td width="250"> 
     <a class="headLineLink2" href="http://www.khl.com{$path}/{link}{$title}?nltr=rw"> 
      <strong> 
      <xsl:value-of select="name" /> 
      </strong> 
     </a> 
     </td> 
    </tr> 
    <td width="110" valign="top" class="tumbImage"> 
     <a href="http://www.khl.com{$path}/{link}{$title}?nltr=rw"> 
     <xsl:choose> 
      <xsl:when test="item-links/item-link[@id=466]/items/item[1]"> 
      <img border="0" width="110" height="80" align="left" src="http://www.khl.com{item-links/item-link[@id=466]/items/item/derived-files/preview}"/> 
      </xsl:when> 
      <xsl:otherwise> 
      <img border="0" width="110" height="80" align="left" src="http://www.khl.com{item-links/item-link[@id=2]/items/item/derived-files/preview}"/> 
      <img src="http://www.khl.com/other_files/newsletters/spacer-new.gif" width="10" height="110" align="left"></img> 
      </xsl:otherwise> 
     </xsl:choose> 
     </a> 
     <xsl:value-of select="substring(content/item/standfirst,0,120)" disable-output-escaping="yes"/> 
     <xsl:text>...</xsl:text> 
    </td> 


    </xsl:template> 


    <xsl:template match="data-item" mode="top-story"> 

    <xsl:variable name="title"> 
     <xsl:call-template name="replaceTitle"> 
     <xsl:with-param name="title" select="content/item/title"/> 
     </xsl:call-template> 
    </xsl:variable> 

    <xsl:variable name="path"> 
     <xsl:call-template name="detail_path"> 
     <xsl:with-param name="item" select="current()"/> 
     </xsl:call-template> 
    </xsl:variable> 

    <td valign="top" bgcolor="#ffffff" class="tumbImage"> 
     <a href="http://www.khl.com{$path}/{link}{$title}?nltr=wd"> 
     <xsl:choose> 
      <xsl:when test="item-links/item-link[@id=466]/items/item[1]"> 
      <img border="0" width="200" height="146" src="http://www.khl.com{item-links/item-link[@id=466]/items/item/derived-files/preview}"/> 
      </xsl:when> 
      <xsl:otherwise> 
      <img border="0" width="200" height="146" src="http://www.khl.com{item-links/item-link[@id=2]/items/item/derived-files/preview}"/> 
      </xsl:otherwise> 
     </xsl:choose> 

     </a> 
    </td> 

    <td valign="top" bgcolor="#ffffff"> 
     <span class="headLineLink"> 
     <a href="http://www.khl.com{$path}/{link}{$title}?nltr=wd"> 
      <strong> 
      <xsl:value-of select="name" /> 
      </strong> 
     </a> 
     </span> 
     <p> 
     <span class="toparticlemaintext"> 
      <xsl:value-of select="substring(content/item/standfirst,0,282)" disable-output-escaping="yes"/> 
      <p>&nbsp;</p> 
      <xsl:text> </xsl:text> 
     </span> 
     <a class="moreLink" href="http://www.khl.com{$path}/{link}{$title}?nltr=wd">View article »</a> 
     </p> 
    </td> 
    </xsl:template> 


    <xsl:template match="data-item" mode="other"> 

    <xsl:variable name="title"> 
     <xsl:call-template name="replaceTitle"> 
     <xsl:with-param name="title" select="content/item/title"/> 
     </xsl:call-template> 
    </xsl:variable> 

    <xsl:variable name="path"> 
     <xsl:call-template name="detail_path"> 
     <xsl:with-param name="item" select="current()"/> 
     </xsl:call-template> 
    </xsl:variable> 

    <td> 
     <a href="http://www.khl.com{$path}/{link}{$title}?nltr=wd"> 
     <xsl:choose> 
      <xsl:when test="item-links/item-link[@id=466]/items/item[1]"> 
      <img border="0" width="130" height="80" src="http://www.khl.com{item-links/item-link[@id=466]/items/item/derived-files/preview}"/> 
      </xsl:when> 

      <xsl:otherwise> 
      <img border="0" width="130" height="80" src="http://www.khl.com{item-links/item-link[@id=2]/items/item/derived-files/preview}"/> 
      </xsl:otherwise> 
     </xsl:choose> 
     </a> 
    </td> 
    <td valign="top"> 
     <a class="headLineLink" href="http://www.khl.com{$path}/{link}{$title}?nltr=wd"> 
     <strong> 
      <xsl:value-of select="name" /> 
     </strong> 
     </a> 
     <p> 
     <span name="input-code"> 
      <xsl:value-of select="substring(content/item/standfirst,0,282)" disable-output-escaping="yes"/> 
      <xsl:text> . . .</xsl:text> 
     </span> 
     <a class="moreLink" href="http://www.khl.com{$path}/{link}{$title}?nltr=wd">more</a> 
     </p> 
    </td> 

    </xsl:template> 


</xsl:stylesheet> 

XML代碼:

<?xml version="1.0" encoding="UTF-8"?> 

<search-results> 
    <size>0</size> 
    <start-index>1</start-index> 
    <end-index>1</end-index> 
    <page-no>1</page-no> 
    <no-of-pages>1</no-of-pages> 
    <items-per-page>0</items-per-page> 
    <forward> 
    <action>/vyre4/pub_module/pageview4757_70?portal:componentId=16821&amp;portal:type=action&amp;portal:isSecure=false&amp;portal:portletMode=xml</action> 
    </forward> 
    <action-path>/vyre4/pub_module/pageview4757_70?portal:componentId=16821&amp;portal:type=action&amp;portal:isSecure=false&amp;portal:portletMode=xml</action-path> 
    <action-extensions> 
    <add-to-basket> 
     <order>&amp;addToBasket=order</order> 
     <bulk-edit>&amp;addToBasket=bulkEdit</bulk-edit> 
    </add-to-basket> 
    <sortable-attributes> 
     <score>&amp;sortBy=score</score> 
     <name>&amp;sortBy=sort_name</name> 
     <creationDate>&amp;sortBy=sort_creationDate_t</creationDate> 
     <lastModifiedDate>&amp;sortBy=sort_lastModifiedDate_t</lastModifiedDate> 
     <viewCount>&amp;sortBy=viewCount</viewCount> 
     <orderCount>&amp;sortBy=orderCount</orderCount> 
     <ratingAverage>&amp;sortBy=ratingAverage</ratingAverage> 
     <creatorFamilyName>&amp;sortBy=sort_creatorFamilyName_s</creatorFamilyName> 
     <creatorFullName>&amp;sortBy=sort_creatorFullName_s</creatorFullName> 
     <creatorGivenName>&amp;sortBy=sort_creatorGivenName_s</creatorGivenName> 
     <creatorUserName>&amp;sortBy=sort_creatorUserName_s</creatorUserName> 
     <lastModifierFamilyName>&amp;sortBy=sort_lastModifierFamilyName_s</lastModifierFamilyName> 
     <lastModifierFullName>&amp;sortBy=sort_lastModifierFullName_s</lastModifierFullName> 
     <lastModifierGivenName>&amp;sortBy=sort_lastModifierGivenName_s</lastModifierGivenName> 
     <lastModifierUserName>&amp;sortBy=sort_lastModifierUserName_s</lastModifierUserName> 
     <att869>&amp;sortBy=sort_att869_s</att869> 
     <att10>&amp;sortBy=sort_att10_s</att10> 
     <att871>&amp;sortBy=sort_att871_s</att871> 
     <att870>&amp;sortBy=sort_att870_s</att870> 
     <att5>&amp;sortBy=sort_att5_s</att5> 
     <att8>&amp;sortBy=sort_att8_t</att8> 
    </sortable-attributes> 
    <sort-directions> 
     <asc>&amp;orderBy=asc</asc> 
     <desc>&amp;orderBy=desc</desc> 
    </sort-directions> 
    <items-per-page>&amp;itemsPerPage=</items-per-page> 
    <do-redirect>&amp;doRedirect=</do-redirect> 
    <page-no>&amp;pageNo=</page-no> 
    <previous-actions/> 
    </action-extensions> 
    <search-term>+(+(+active:true +att7:1 +att8:[0 TO $current_date] +(ITEM_LINK_DEF641:$current_item_id OR ITEM_LINK_DEF642:$current_item_id OR ITEM_LINK_DEF643:$current_item_id OR ITEM_LINK_DEF644:$current_item_id OR ITEM_LINK_DEF645:$current_item_id OR ITEM_LINK_DEF646:$current_item_id OR ITEM_LINK_DEF647:$current_item_id OR ITEM_LINK_DEF648:$current_item_id OR ITEM_LINK_DEF649:$current_item_id OR ITEM_LINK_DEF650:$current_item_id OR ITEM_LINK_DEF652:$current_item_id OR ITEM_LINK_DEF669:$current_item_id OR ITEM_LINK_DEF670:$current_item_id or ITEM_LINK_DEF691:$current_item_id))) +locale:en -(ITEM_LINK_DEF9:57303 OR ITEM_LINK_DEF9:57302)</search-term> 
    <sorting> 
    <first-sort-field>att8</first-sort-field> 
    <first-sort-field-direction>desc</first-sort-field-direction> 
    <second-sort-field>lastModifiedDate</second-sort-field> 
    <second-sort-field-direction>desc</second-sort-field-direction> 
    </sorting> 
    <items/> 
</search-results> 
+0

你的輸入XML是什麼樣的? – JLRishe

+0

嗨XML是好的,因爲所有的數據都被拉出來,並且在這個評論中打印太長編輯:張貼以上 – user3036451

+0

我並不是說你的XML有問題。我指出我們需要一些XML來測試和理解你的509行XSLT。 – JLRishe

回答

0

XSLT代碼必須是格式良好的XML。這意味着您不能將起始表標籤拆分爲一個模板,將終端標籤拆分成另一個;每個模板必須平衡。

我沒有詳細看過你的樣式表,但通常的解決方法是將<table></table>對移到一個水平,將它們圍繞產生表格內容的<xsl:apply-templates>

+0

我認爲這可能是這種情況。但我似乎無法找到它。我會繼續搜索,但不幸的是沒有編譯器。所以,我對代碼進行的任何修改都是手動預覽的,而且這需要我一個年齡。 – user3036451

+0

嘗試(暫時)儘可能簡化樣式表,同時仍然會引發問題。這應該有助於您發現不匹配的發生位置。 – keshlam

+0

請注意,使用規則驅動樣式(模板xsl:apply-templates和matching)而不是拉樣式(一個大規模模板)編寫樣式表時,通常更容易進行調試。較小的代碼塊更易於閱讀和理解,並保持平衡。而FAR更容易維護。如果沒有別的,可以考慮將它分成命名模板,並使用xsl:call-template將它們作爲子例程調用,以使代碼更加模塊化和可讀。 – keshlam