![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - XSL Copy Of Cannot Contain Templates >Thread Next - Re: XSL Copy Of Cannot Contain Templates Re: XSL Copy Of Cannot Contain TemplatesTo: NULL Date: 11/1/2006 8:35:00 PM > 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 > <!-- HELP --> > <xsl:copy-of select="docDescription"> > <xsl:apply-templates select="acronym" /> > <xsl:apply-templates select="a" /> > </xsl:copy-of> > <!-- HELP END --> Then what you're running this with is definitely not a compliant XSLT processor! Not to mention that the provided "XSLT" code is not even wellformed. Cheers, Dimitre Novatchev <zakhirn@g...> wrote in message news:1162419407.644295.170400@m...... > 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 "<xsl:value-of > select="$strSearch"/>" </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: "<xsl:value-of > select="$strSearch"/>" </span> </h2> > <br /><ol> > <xsl:choose> > <xsl:when test="$nameCount > 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) > 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> > | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
