Schema Metadata not a Metadata Schema

B

Brett Selleck

I would like to start collecting Metadata on my XML schemas. I have
searched the web for a method of automatically extracting Metadata
from an XSD file and have come up empty handed. Basically what I am
looking for is a VB Script or J Script that parses an XSD file and
outputs the metadata in a structured format. For examle: Given this
simple Schema below I would like to see the following.

Schema:
<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">

<xs:element name="Book">

<xs:complexType>

<xs:all>

<xs:element ref="ISBN"/>

<xs:element ref="Title"/>

<xs:element name="Author" type="xs:string"/>

</xs:all>

</xs:complexType>

</xs:element>

<xs:element name="Title" type="xs:string"/>

<xs:element name="ISBN" type="xs:long"/>

</xs:schema>

I would like to see this:

Element DataType IsGlobal Parent
ISBN long Y Book
Title string Y Book
Author string N Book
Book ComplexType Y Schema

Has anybody seen a tool that will do this? Or have a strategy on how
to extract this information?

Thanks,
 
A

Andy Dingley

I would like to start collecting Metadata on my XML schemas.

What is "metadata on a schema" ?

If an author creates a schema and embeds some metadata, then you can
extract it. You might find <xs:annotation> & <xs:documentation> and
use their contents. You could also infer metadata, from the initial
URL of a schema, or from any <xs:include> elements you might
encounter.

Then you can take this set of metadata properties you have, and
publish this application-schema-metadata through a popular
metadata-schema, such as Dublin Core.

You could do this operation though many ways, but XSLT would be an
obvious choice.

<xs:element name="Title" type="xs:string"/>

<xs:element name="ISBN" type="xs:long"/>

</xs:schema>

I would like to see this:

Element DataType IsGlobal Parent
ISBN long Y Book
Title string Y Book


This looks like a different problem. This is scanning a schema to see
if it contains elements that are suggestive of being
"metadata-related" properties, and then extracting them.

Again, you could use XSLT to do much of this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top