RE: [xsl] Finding the Undefined Elements

Subject: RE: [xsl] Finding the Undefined Elements
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Mon, 20 Jun 2005 10:09:15 +0100
> Greetings All,
>
> I am converting one format of XML to another XML by using XSL
> Transformation; I require the list of elements that I am not
> addressed in my XSL. Please advice.

One technique is to have a template:

<xsl:template match="*">
  <xsl:text/>Unmatched Element: <xsl:value-of select="local-name()"/>
  <xsl:apply-templates/>
</xsl:template>

This will then match any elements that would otherwise be handled by the
inbuilt 'default' template.

In order to find all elements without a matching template you would need
to ensure you only use the push technique, ie no xsl:for-each or
xsl:apply-templates select="...." so it's a little more involved than
just adding the above template.

cheers
andrew

Current Thread