Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XSL Copy Of Cannot Contain Templates

From: zakhirn@-----.---
To: NULL
Date: 11/1/2006 2:17:00 PM

Hello,

I have created an XSL file to search through my XML document and
display the results.

The problem is with the  <!-- HELP -- > section in the XSL.
If I run from my pc locally, it works fine, but when I upload to server
I get an error message <xsl:copy- of> cannot contain apply (OR) call
-templates.

I know there is a way to do this, but after looking at examples, I just
cannot figure out what the problem is.

I have posted the XSL below, any help would be greatly apprciated.
Thanks a lot!


<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="html" encoding="iso-8859-1"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>

  <!--*****Start of Global variables and parameters***** -->
  <xsl:param name="strSearch" select="''"/>
<xsl:variable name="noLink" select="'No Link - See Above
Description'"/>
<xsl:variable name="lcase" select="'abcdefghijklmnopqrstuvwxyz'"/>
<xsl:variable name="ucase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:variable name="nameCount"
select="count(catalog/webDoc[contains(translate(docName,$lcase,
$ucase),  translate ( $strSearch, $lcase, $ucase))])" />
<xsl:variable name="desCount"
select="count(catalog/webDoc[contains(translate(docDescription,$lcase,
$ucase),  translate ( $strSearch, $lcase, $ucase))])" />
<xsl:variable name="relCount"
select="count(catalog/webDoc[contains(translate(docMeta,$lcase,
$ucase),  translate ( $strSearch, $lcase, $ucase))])" />
  <!--*****End of Global variables and parameters***** -->

  <xsl:template match="/">
  <link rel="stylesheet" type="text/css" href="../common/xsl.css" />


 <div id="SResults" class="sere">
   <h2><span class="strong2"> Search Results for &quot;<xsl:value-of
select="$strSearch"/>&quot; </span></h2>
   <div class="12">
     <ul class="margin">
       <li><a href="#name">Matches by FORM NAME (<xsl:value-of
select="$nameCount" />) </a></li>
     </ul>
   </div></div>

   <xsl:call-template name="main" />
   </xsl:template>

   <xsl:template name="main">
    <!-- *************************** name input starts here
*************************** -->
    <div class="borderform">
	<a name="name" id="name"></a><h2 class="head"> <span
class="strong"><xsl:value-of select="$nameCount" /></span> <span
class="size90"> Matches by Name: &quot;<xsl:value-of
select="$strSearch"/>&quot; </span>  </h2>
    <br /><ol>
    <xsl:choose>
      <xsl:when test="$nameCount &gt; 0 ">
       <xsl:for-each
select="catalog/webDoc[contains(translate(docName,$lcase, $ucase),
translate ( $strSearch, $lcase, $ucase))]">

          <li><h3 ><span class="strong3"><xsl:value-of
select="docName"/></span></h3>
		    <div class="LI"><span class="strong">Description: </span>

			<!-- HELP -->
			 <xsl:copy-of select="docDescription">
			<xsl:apply-templates select="acronym" />
			<xsl:apply-templates select="a" />
			</xsl:copy-of>
			<!-- HELP END -->
</div>

		 <xsl:call-template name="searchIfs" />

        </li></xsl:for-each>

      </xsl:when>
      <xsl:otherwise>

      </xsl:otherwise>
    </xsl:choose>
	</ol>
	<xsl:call-template name="TOP"/><br />
	</div>
    <!-- ************************************** End of input name
************************************** -->

  </xsl:template>
  <!-- ************************************** TEMPLATES
************************************** -->

   <xsl:template match="child::acronym" name="acronym">
 <!-- find content with acronyms-->
    <acronym >
	  <xsl:attribute name="title"><xsl:value-of
select="@title"/></xsl:attribute>
	  <xsl:value-of select="."/>
	  <xsl:apply-templates/>
    </acronym>
  </xsl:template>

  <xsl:template match="child::a" name="links">
    <a>
      <xsl:attribute name=" href"><xsl:value-of select="@href"
/></xsl:attribute>
       <xsl:value-of select="."/>
       <xsl:apply-templates/>
    </a>
  </xsl:template>


  <xsl:template name="searchIfs">
  <xsl:choose>
            <xsl:when test="count(hLink) &gt; 1">
              <span class="strong rLI">Links:</span><br />
              <xsl:for-each select="hLink" >
                <xsl:sort data-type="number" select="@TON"
order="ascending" />

                <div class="resultLinks">
                <xsl:for-each select=".">
                  <xsl:if test="@TON = 01375">
                    <span class="strong4"><acronym><xsl:attribute
name="title">Terminal Office Number 1</xsl:attribute>TON1</acronym>:
</span><a>
                    <xsl:attribute name="href"><xsl:value-of
select="node()" /></xsl:attribute>
                    <xsl:value-of select="docName"/><xsl:value-of
select="ancestor::webDoc/docName"/>

					<xsl:if test="count(ancestor::webDoc/hLink/@docSize) >= 1"> -
<xsl:value-of select="@docSize"/></xsl:if>
					</a>
                  </xsl:if>
                  <xsl:if test="@TON = 41253">
                    <span class="strong4"><acronym><xsl:attribute
name="title">Terminal Office Number 4</xsl:attribute>TON4</acronym>:
</span><a>
                    <xsl:attribute name="href"><xsl:value-of
select="node()" /></xsl:attribute>
                    <xsl:value-of select="docName"/><xsl:value-of
select="ancestor::webDoc/docName"/>

					<xsl:if test="count(ancestor::webDoc/hLink/@docSize) >= 1"> -
<xsl:value-of select="@docSize"/></xsl:if>
					</a>
                  </xsl:if>

                </xsl:for-each>
                </div>
              </xsl:for-each>
              <br />
            </xsl:when>
            <xsl:otherwise>

          </xsl:choose>
  </xsl:template>

  <xsl:template name="TOP" >
    <div class="alignRight">
      <a href="#Top">Top of page</a>
    </div>
  </xsl:template>
</xsl:stylesheet>



transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent