W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2016

Re: Tool that finds unused simpleTypes?

From: Loren Cahlander <loren.cahlander@gmail.com>
Date: Wed, 30 Mar 2016 11:24:52 -0400
Cc: "Costello, Roger L." <costello@mitre.org>, "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-Id: <99479837-BC01-4830-B246-5D8B0B5BBC88@gmail.com>
To: Michael Kay <mike@saxonica.com>
Try the following (untested) snippet

fn:distinct-values($schema//xs:simpleType/@name[not(.=$schema//xs:element/@type/string())])

Loren Cahlander

> On Mar 28, 2016, at 1:19 PM, Michael Kay <mike@saxonica.com> wrote:
> 
> Saxon's schema processor has the option -stats:filename to report on the usage of schema components during a validation episode. IIRC it only lists the components that were used (not those that weren't) but you could do some post-processing to derive this information.
> 
> Michael Kay
> Saxonica
> 
> 
>> On 28 Mar 2016, at 17:42, Costello, Roger L. <costello@mitre.org> wrote:
>> 
>> Hi Folks,
>> 
>> I am seeking a Java tool that finds all unused simpleTypes in an XML Schema.
>> 
>> Does such a tool exist?
>> 
>> /Roger
>> 
> 
> 
> 
Received on Wednesday, 30 March 2016 15:25:23 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 30 March 2016 15:25:24 UTC