Sonja Löhr <[EMAIL PROTECTED]> writes:
<xsl:template match="map/area">
    <xsl:copy>
        <xsl:apply-templates select="@coords"/>
        <xsl:apply-templates select="@shape"/>
        <xsl:attribute name="href">
            <xsl:value-of select="$country_url"/>etc.
        </xsl:attribute>
    </xsl:copy>
</xsl:template>
>With each area element I get the following warning:
>That is: "attribute 'href' is not inside an element"

The two apply-templates for @coords and @shape must only construct 
attributes or namespace
declarations, because nodes of those two types must be constructed within 
an element before
any text nodes, comments, child elements, or processing instructions.

Since the order of the attributes is irrelevant, I suggest putting the 
xsl:attribute instruction before
the  two apply-templates. Even so, you should review the templates that 
would be invoked by the
two apply-templates to ensure that they finish constructing attributes 
before the other kinds of
nodes.
.................David Marston

Reply via email to