Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - Schema refactoring tools [Thread Next] Re: [xml-dev] Schema refactoring toolsTo: "XML DEV" <xml-dev@-----.---.---> Date: 7/13/2007 5:48:00 PM Would not just a powerful enough text editor to allow multi-line 'find
and replace' do the trick?
e.g. First a find and replace say to change the type name from 'old' to 'new'.
then find
<element name="d" type="string"/>
and replace with
</sequence>
</complexType>
<complexType name="old">
<complexContent>
<extension base="tns:new">
<sequence>
Sorry if that sounds oversimplistic. Personally I find a set of decent
text editors as useful as the more sophisticated jobs for some things
like this.
--
Stephen Green
Partner
SystML, http://www.systml.co.uk
Tel: +44 (0) 117 9541606
http://www.biblegateway.com/passage/?search=matthew+22:37 .. and voice
On 13/07/07, Dennis Sosnoski <dms@s...> wrote:
> I was looking at refactoring from the standpoint of the data represented
> rather than the XML documents, but it's true that changing an attribute
> to a child element is probably not the best example. Still a useful
> feature for a tool, though.
>
> A better example would be to convert local to global types and elements,
> with automatic substitution of the new global type wherever appropriate.
> Better still if the tool allowed me to do things such as select the
> first three child elements from an existing complexType/sequence to be
> made into a new type definition, converting the existing type to an
> extension of the new type. So:
>
> <complexType name="old">
> <sequence>
> <element name="a" type="string"/>
> <element name="b" type="string"/>
> <element name="c" type="string"/>
> <element name="d" type="string"/>
> </sequence>
> </complexType>
>
> to:
>
> <complexType name="new">
> <sequence>
> <element name="a" type="string"/>
> <element name="b" type="string"/>
> <element name="c" type="string"/>
> </sequence>
> </complexType>
>
> <complexType name="old">
> <complexContent>
> <extension base="tns:new">
> <sequence>
> <element name="d" type="string"/>
> </sequence>
> </extension>
> </complexContent>
> </complexType>
>
> - Dennis
> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
