473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Flatten XSD

mre
Is there a program that will flatten an XSD, that is, will transform...

<xsd:element name="name" type="nameType"/>

<xsd:complexType name="nameType">
<xsd:sequence>
<xsd:element name="firstname" type="xsd:string"/>
<xsd:element name="surname" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>

....into...

<xsd:element name="name">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="firstname" type="xsd:string"/>
<xsd:element name="surname" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

.... It should also handle includes/imports, merge complexContent, and
what have you?

I want to be able to take multiple XSDs, most of which contain just
type information in various namespaces, and turn it all it one big
file, one namespace.

If there is no program that can do this I'll write one myself. However,
as I'm an XSD beginner; how does complexContent and group merge? I'm
guessing that, other than these two, the rest is as straight-forward as
my example above - is there anything I need to watch out for?

Thank you for any help,
Regards,
MRe

Jul 20 '05 #1
1 2074
mre
I've started writing a prog myself and would appreciate any helps
anyone can give

What does <xsd:element ref="foo:bar"> mean? Do I replace that element
with the 'bar' element? The bar element looks like this <xsd:element
name="bar" type="foo:barType" abstract="true">. It seems to me that ref
and type are almost the same thing?

Also,
This is short version of something I got off www.w3schools.com...

<xsd:element name="employee" type="fullpersoninfo"/>
<xsd:complexType name="personinfo">
<xsd:sequence><xsd:element name="firstname"
type="xsd:string"/></xsd:sequence>
<xsd:attribute name="lastUpdateDate" type="xsd:date" use="optional" />
</xsd:complexType>
<xsd:complexType name="fullpersoninfo">
<xsd:complexContent>
<xsd:extension base="personinfo">
<xsd:sequence><xsd:element name="address"
type="xsd:string"/></xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

....should it become...

<xsd:element name="employee">
<xsd:complexType >
<xsd:complexContent>
<xsd:sequence><xsd:element name="firstname"
type="xsd:string"/></xsd:sequence>
<xsd:attribute name="lastUpdateDate" type="xsd:date" use="optional"
/>
<xsd:sequence><xsd:element name="address"
type="xsd:string"/></xsd:sequence>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>

....or should the double xsd:sequence be grouped into one, or should
something else happen, or what?

Also,
What does group and substitutionGroup mean for my program.

Please help, please!
Thank you,
Regards,
MRe

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Francis Avila | last post by:
Below is an implementation a 'flattening' recursive generator (take a nested iterator and remove all its nesting). Is this possibly general and useful enough to be included in itertools? (I know...
0
by: Francis Avila | last post by:
A few days ago (see the 'itertools.flatten()?' thread from October 28) I became obsessed with refactoring a recursive generator that yielded the leaves of nested iterables. When the dust settled,...
10
by: bearophile | last post by:
This is my first Python program (it's an improvement of a recursive version by Luther Blissett). Given a list like this: , ]]] It produces the "flatted" version: I think this operation is...
3
by: Bengt Richter | last post by:
What am I missing? (this is from 2.4b1, so probably it has been fixed?) def flatten(list): l = for elt in list: ^^^^--must be expecting list instance or other sequence t = type(elt) if t...
18
by: Ville Vainio | last post by:
For quick-and-dirty stuff, it's often convenient to flatten a sequence (which perl does, surprise surprise, by default): ]]] -> One such implementation is at ...
181
by: Tom Anderson | last post by:
Comrades, During our current discussion of the fate of functional constructs in python, someone brought up Guido's bull on the matter: http://www.artima.com/weblogs/viewpost.jsp?thread=98196 ...
2
by: delgados129 | last post by:
I've seen a few XSL examples to flatten a specific node, but none that address this specific scenario: Given the following generic XML: <DocElement> <A attr="attribForA">TextForA</A>...
32
by: Robin Becker | last post by:
Is there some smart/fast way to flatten a level one list using the latest iterator/generator idioms. The problem arises in coneverting lists of (x,y) coordinates into a single list of...
25
by: beginner | last post by:
Hi, I am wondering how do I 'flatten' a list or a tuple? For example, I'd like to transform or ] to . Another question is how do I pass a tuple or list of all the aurgements of a function to...
1
by: farooq.omar | last post by:
Is there a way to specify to Flatten() method as to how many points it should return. example I just want the Flatten() method to give back 100 points (basicallt gp.PointCount==100). Thanks
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.