Re: [xsl] weed out unused global reference in an xsd document

Subject: Re: [xsl] weed out unused global reference in an xsd document
From: Tom Schutzer-Weissmann <xsl@xxxxxxxxxxxxxxxx>
Date: Fri, 5 Sep 2003 16:21:52 +0000
On Friday 05 Sep 2003 12:50, Tim Müller-Seydlitz wrote:
> Hi,
> I want to work on a xsd document. Where I want to weed out the global
> elements that are not referenced to anymore.
> How could I do it with xslt?

Do an identity transform and add a template to soak up all the top-level 
xs:elements which aren't referenced elsewhere - you'll need a key to know if 
they are.
<xsl:key name="refs" match="@ref" use="."/>
...
<xsl:template match="xs:schema/xs:element[not(key('refs',@name))]"/>

regards,
Tom SW
--
"The facts are hideous, but we must face them" - Bertie Wooster


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


Current Thread