This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Keyword xsl:call-template may not be used here.


Hi Jim,

<xsl:call-template> should cause no problems at that place. But the template
I think you want to call has no name. This is A problem and could cause THE
misleading error message. Which parser/transformer are you using?

And there is no need in your code for using <xsl:element> and
<xsl:attribute>:

<!-- this
> <xsl:element name="img">
> <xsl:attribute
> name="src">http://aiur/XML_Files/TreeView/open.gif</xsl:attribute>
> </xsl:element>
> <xsl:element name="A">
> <xsl:value-of select="name()" />
> </xsl:element>

can be changed to this: -->

<img src="http://aiur/XML_Files/TreeView/open.gif"/>
<a><xsl:value-of select="name()" /></a>

Even for dynamic values you don't need <xsl:attribute>, you can use the so
called "attribute value template":

<img src="{@href}"/>

This takes the value of the attribute href of the matched node to <img
src=".."/>

<xsl:element> is needed for dynamic naming of a new element, <xsl:attribute>
is used for more complex value of an attribute.

Joerg


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]