Skip to content

Review check for misplaced alg elements in check_algsupport #23

@philsmart

Description

@philsmart

The template:

<xsl:template match="alg:*[count(parent::md:Extensions)=0]">
        <xsl:call-template name="error">
            <xsl:with-param name="m">
                <xsl:text>alg:</xsl:text>
                <xsl:value-of select="local-name()"/>
                <xsl:text> must only appear within an Extensions element</xsl:text>
            </xsl:with-param>
        </xsl:call-template>
    </xsl:template>

Was converted from the match pattern alg:*[not(parent::md:Extensions)] to alg:*[count(parent::md:Extensions)=0] to overcome a potential bug in the native Java XSLT processor. This might not be the most effective way to find such errors, so needs review. An alternative exists (but is more generic on the match, so might prevent further templates from matching on alg:).

<xsl:template match="alg:*">
        <xsl:if test="not(parent::md:Extensions)">
	        <xsl:call-template name="error">
	            <xsl:with-param name="m">
	                <xsl:text>alg:</xsl:text>
	                <xsl:value-of select="local-name()"/>
	                <xsl:text> must only appear within an Extensions element</xsl:text>
	            </xsl:with-param>
	        </xsl:call-template>
        </xsl:if>
    </xsl:template>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions