Open JThoennes opened 2 years ago
@donmendelson Do you think I am correct here? Do I missing something?
The Dublin Core XML namespaces are a bit confusing.
dc.xsd
has target namespace "http://purl.org/dc/elements/1.1/"
dcterms.xsd
has target namespace "http://purl.org/dc/terms/". But it also imports dc.xsd
.
Therefore, many of the terms, such as subject
can be valid in both namespaces.
So I wonder why the official Orchestra FIX Latest XML does use the other way?
In addition, my IDE complains about the dcterms:
usage so I would prefer to have it in one common way.
A bit more detail on namespaces:
A complete explanation of Dublin Core Terms Initiative namespaces is here: Namespace Policy for the Dublin Core™ Metadata Initiative (DCMI)
In short...
http://purl.org/dc/elements/1.1/ namespace
is a subset of original 15 termshttp://purl.org/dc/dcmitype/
enumerates typeshttp://purl.org/dc/terms/
imports the above into its own namespaceTherefore only http://purl.org/dc/terms/
should be necessary for our purposes.
The Orchestra repository schema defines metadata element like this;
<xs:element name="metadata" type="dcterms:elementOrRefinementContainer"/>
and the dcterms
namespace is defined like this:
xmlns:dcterms="http://purl.org/dc/terms/"
Therefore, I believe the repository schema is using the correct namespace.
The FIX Latest file (EP 272) in the orchestrations repository also defines the namespace as
xmlns:dcterms="http://purl.org/dc/terms/"
This is also correct.
@JThoennes, the file you referred to was produced by a different process (XSLT) while starting with EP272 we started publishing a file produced with a Python script. In short, I believe that the problem has been resolved, at least in this instance.
Nevertheless, we need to examine how other tools that write Orchestra files are managing namespaces. This has always been one of the tricky aspects of XML schema usage, and I thank you for bringing it to our attention.
One last comment on namespaces: when an XML namespace is declared in an XML file with xmlns
, only the URI following the equal sign has universal significance. The prefix before the equal sign is an alias for the namespace that has scope only for that XML file. Therefore, a different prefix can be used, but the only thing that really matters is that it points to the correct URI.
Thanks, @donmendelson, for your detailed answer! Did not visit this space for a while.
Comparing the output of
md2orchestra
to the Orchestra file of FIX Latest, I see some notable differences: While the Orchestra FIX Latest only uses thedc:
XML name space, the generated XML code usesdcterms:
which causes validation errors in my IDE.I think that the
<fixr:metadata>
elements only allows<dc:*>
. The Orchestra FIX Latest adheres to this restriction:while the generated code looks like:
I think the problem is the Tablature
RepositoryMapper.getPreferredPrefix()
. Thedcterms
case should be removed. Then both the XML name space declaration is dropped and thedc:
prefix is used.