xsl-list
[Top] [All Lists]

Re: weed out unused global reference in an xsd document

2003-09-05 09:21:52
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



<Prev in Thread] Current Thread [Next in Thread>