tracefirst / usaha_committee

XML schema for electronic CVIs
8 stars 2 forks source link

Namespaces #16

Closed mkm1879 closed 10 years ago

mkm1879 commented 10 years ago

Very hidden technical issue:

We will most likely want to change the default namespace for the schema from "StateVet" to something not trademarked by any one member of the subcommittee.

jconlon commented 10 years ago

Do we have a Namespace 'schema' for our 'schema' (i.e. our vocabulary)? Meaning have we worked out the format for the namespace or given it any thought? While we can use just about anything, including keeping it as 'StateVet' there are some conventions that we should probably follow.

A well conceived namespace is important as it will allow XML authors (the users of our schema) to incorporate it into XML instance document and even combine it with other XML vocabularies (defined by other schema developers). The important part is to globally uniquely define it.

Here is an example of a namespace used by the OSGi Association for its 'scr' vocabulary. http://www.osgi.org/xmlns/scr/v1.2.0

Note the use of the url, the separator 'xmlns', the actual document namespace and the version.

A proposed strawman namespace for discussion: http://www.usaha.org/xmlns/ecvi/v0.1.0

This will allow us to use a similar format for other schemas as/if we define them. Of course this versioning thing on the end will need discussion as to how we manage it as.

mmcgrath commented 10 years ago

I second John's idea to change the namespace to http://www.usaha.org/xmlns/ecvi/v0.1.0

mmcgrath commented 10 years ago

I don't know how to do this - can someone who does rewrite the schema header: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="StateVet" version="6.0" xmlns="StateVet">

Feel free to add the revised header to this issue and I'll make the change and push to github.....

mkm1879 commented 10 years ago

I pushed an update.
targetNamespace="http://www.usaha.org/xmlns/ecvi/v0.1.0" version="6.0" xmlns="http://www.usaha.org/xmlns/ecvi/v0.1.0">

To use this namespace, documents need to declare the namespace in the root element <eCVI xmlns="http://www.usaha.org/xmlns/ecvi/v0.1.0" ...>

Documents can also use namespace synonyms and prefix each tag, but this way is easier unless you are mixing elements from different namespaces.

mmcgrath commented 10 years ago

Addressed in 72b79c07505b52b5ae7933c494b50c1e1f0d6fd0 and 9c5dff0ad3bd36b6b351405ba9c7eea31f4ae9ba

jconlon commented 10 years ago

Note that now we have two kinds of versioning for our schema.

  1. Changing the (internal) schema version attribute, (version="6.0")
  2. Changing the schema's targetNamespace (targetNamespace="http://www.usaha.org/xmlns/ecvi/v0.1.0") See this: http://lists.xml.org/archives/xml-dev/200109/msg00106.html

This may be what we want but we should understand the practical implications for this as we change and version the schema...

The way it is now we can put anything in the version attribute and it will not require changes to tools that use the schema and the validation of instance documents referencing the schema, but changing anything in the targetNamespace will.

Even though we now have these two parts describing version, for the purpose of identification of the schema as it changes we have a 5 parts that we can change.

0.1.0 6.0

The 'major' three parts (on the left) are from the target Namespace (changing these breaks backward compatibility), the two on the right (changes are non-breaking) are from the version attribute. IMO this is just overkill and I would recommend that we reduce this to just a three part version id. (A three part fits more with industry best practices for versioning: i.e. Major.Minor.Patch as in http://semver.org/)

Have seen the following scenarios used for a 3 part versioning in schemas: A. Just a targetNamespace (targetNamespace="http://www.usaha.org/xmlns/ecvi/v0.1.6") B. Redundant version attr and targetNamespace (targetNamespace="http://www.usaha.org/xmlns/ecvi/v0.1.6" version="0.1.6") C. Composite (targetNamespace="http://www.usaha.org/xmlns/ecvi/v0.1" version="6")

I sort of like the last 'C' option.

mkm1879 commented 10 years ago

I agree with the "overkill" part. In my editing the schema I just inserted the URI that had been proposed earlier. As I see it, the need to create a new namespace URI would only arise if we see a need to mix schemas without having names collide. I would be inclined to have one namespace per standard and track versions of the schema in the version attribute.

Maybe a D option: (targetNamespace="http://www.usaha.org/xmlns/ecvi" version="6") or maybe (targetNamespace="http://www.usaha.org/xmlns/ecvi/v1" version="6") if we believe we will have a second version that will have colliding names and need to be mixed with the current version.

Mike

jconlon commented 10 years ago

I like your D part two option. (targetNamespace="http://www.usaha.org/xmlns/ecvi/v1" version="6")

This will simplify version yet leave us with more options in the future.

mmcgrath commented 10 years ago

@mkm1879 did this in d4a7c5499afce692724a89ad10d9d16cae4237f9

I will close this by end October unless objections are raised before then