annoying senseless warnings 2005-10-09 - By david_marston@(protected)
Sonja L�hr <sonjaloehr@(protected)> writes: <xsl:template match="map/area"> <xsl:copy> <xsl:apply-templates select="@(protected)"/> <xsl:apply-templates select="@(protected)"/> <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 @(protected) and @(protected) 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
|
|