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

Subject: [xsl] weed out unused global reference in an xsd document
From: Tim Müller-Seydlitz <tms@xxxxxxxxxxxxxxxxxx>
Date: Fri, 05 Sep 2003 14:50:28 +0200
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?
Let me be a bit more specific. From a file that looks like this

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.you-know-who.com/2003/"; xmlns="http://www.you-know-who.com/2003/"; xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="Account">
<xs:element ref="bankCode" minOccurs="0"/>
<xs:element ref="branchNumber" minOccurs="0"/>
<xs:element ref="accountNumber" minOccurs="0"/>
<xs:element name="account" type="Account">
<xs:element name="accountNumber" type="xs:string">
<xs:element name="bankCode" type="xs:string"/>
<xs:element name="branchNumber" type="xs:string">
<xs:element name="currency" type="xs:string" />

I want that <xs:element name="currency" type="xs:string" /> and all other unused references in a larger document do not appear in the output anymore.
Apart from that the xsd shall remain unchanged
Regards for your help.

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

Current Thread