Thank your for your help, do you know if there's a way to achieve the same result without using the nested template?
Main Topics
Browse All TopicsI am receiving an error when trying to transform an xml doc with the xsl below. The error message states:
xsl:template is not allowed in this position in the stylesheet!
Any help in identifying the error and a possible resolution is appreciated.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
there is no "the same result" because a nested template will render no result.
Basically you can push out nodes (usually childnodes, but could be a more complex XPath expression)
to be evaluated by the templates.
For that you use <xsl:apply-templates...>
I think what you want to do is something like this
<p>
<xsl:apply-templates select="summary"/>
</p>
Then you can have a template for summary outside the "result" template
That is where templates belong, next to each other, instead of being nested
...
<a>
<xsl:attribute name="href"><xsl:value-of select="reference"/></xsl:at
<xsl:value-of select="reference"/>
</a>
</div>
</xsl:template>
<xsl:template match="summary">
<xsl:call-template name="globalReplace">
<xsl:with-param name="outputString" select="."/>
<xsl:with-param name="target" select="'<br>'"/>
<xsl:with-param name="replacement" select="''"/>
</xsl:call-template>
</xsl:template>
I also removed one mor etypo from you stylesheet
<xsl:template name="paramString">
<xsl:param name="exclude" select="''"/>
note the two single quotes in the select, to indicate the empty string value as a default
Business Accounts
Answer for Membership
by: zc2Posted on 2009-09-03 at 16:57:36ID: 25256053
A template can not reside inside another template.
Look at the line 25 of the snippet you provided, there is <xsl:template> element, but this code around already a template!