RE: [xsl] Searching XSLT scripts to split and merge XSD schema files?

Subject: RE: [xsl] Searching XSLT scripts to split and merge XSD schema files?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 19 Jun 2009 23:05:54 +0100
Generally, manipulation of XSD documents using XSLT is very difficult unless
they have been written to a consistent house-style which your stylesheets
understand. That's because there are so many different ways of expressing
the same underlying schema.

One approach that a few people have now used successfully is to start not
from the XSD documents, but from the schema component model (SCM) exported
by the Saxon schema processor. This is a normalized representation of the
schema (in XML of course), using a model that relates directly to the schema
components described in the XSD specification, where the superficial
differences in surface XSD syntax are lost.

This doesn't of course solve your whole problem, but I would suggest that it
will make it easier to solve.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

 

> -----Original Message-----
> From: Ben Stover [mailto:bxstover@xxxxxxxxxxx] 
> Sent: 19 June 2009 22:20
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Searching XSLT scripts to split and merge XSD 
> schema files?
> 
> Assume I have one XSD Schema file with multiple ComplexTypes inside.
> Now I want to cut one (or some) of these ComplexTypes and put 
> it into a new/existing other, second XSD schema file below a 
> different namespace.
> 
> Of cause this should not be done simply textually but the 
> references/associations should be kept.
> 
> In the original XSD schema file the new XSD schema file must 
> be imported (if not already).
> If the type is used in another ComplexType or Element spec 
> then it should become the prefix of the new namespace.
> 
> Is there such a XSLT script for this purpose?
> 
> Is there a XSLT script for the opposite direction: When 
> MERGING a ComplexType or Element from a second XSD schema 
> file into the current first XSD Schema file?

Current Thread