olofk

Duplicated schema tags

3 posts in this topic

Hi,

I've been looking at creating a Python library to work with IP-XACT. My current attempt (https://github.com/olofk/ipyxact) implements a small subset of IP-XACT, but it would be too much work to do this for the complete standard, so instead I've been looking at using generateDS to help me with the process of creating classes. The problem that appears now is that there are some tags in the schema files with identical names that are defined in several places. An example of this is the viewRef type. It is defined in 7 different places. Some of these are identical, which leaves us with 3 unique definitions. These three unique versions are similar enough so that the python classes are actually identical for all 7 definitions. My question is therefore, should there really only be one definition of viewRef, that all the other can refer to? The same thing would apply to other tags as well, such as accessHandles, registerType, portType etc, or am I missing something? I haven't dealt with xsd files before, so my knowledge of the subject is limited

Share this post


Link to post
Share on other sites

Hello,

In case of viewRef, it may be that the different definitions can be factored out into a single definition. I agree with you that it would have been cleaner to have a single definition rather than duplicating the same definition multiple times. However, for accessHandles and ports there are really different definitions. A port in an abstractionDefinition is different from a port in a component. Hence, your translation to Python classes should include some use of scopes or namespaces.

Best regards,
Erwin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now