usnistgov / iheos-toolkit2

XDS Toolkit
https://ihexds.nist.gov
45 stars 25 forks source link

Wrong namespace in metadata files #575

Closed stl-steve-moore closed 1 year ago

stl-steve-moore commented 1 year ago

Some metadata files contain this namespace which is incorrect: urn:oasis:names:tc:ebxml-regrep:rim:xsd:3.0

Luckily today the code looks at the namespace, decides it is not the right namespace and repairs it. As a side effect, the code also updates other parts of the metadata before sending the transaction.

If you just correct the namespace in the metadata.xml file, I think there will still be additional work to do. When the code sees that the namespace is the proper 3.0 namespace, it does not run the metadata through the translation process. There are other changes that are needed besides metadata that do not happen.

On master:

grep -r urn:oasis:names:tc:ebxml-regrep:rim:xsd:3.0 . | grep xml: | wc 285 815 48613 grep -r urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0 . | wc 2042 8245 576445

skbhaskarla commented 1 year ago

I am updating the ErrorScan tool (gov.nist.toolkit.testengine.engine.ErrorScan) to catch these schema mistakes and fix them using the gov.nist.toolkit.xdstools2.server.MetadataCollectionToMetadata#main method runner tool.

As a side note, I found other problems using the ErrorScan tool and created #576.

skbhaskarla commented 1 year ago

Following are the commits related to tests that have upgraded metadata from v2.1 to v3 or corrected namespace of v2.1: https://github.com/usnistgov/iheos-toolkit2/commit/9b454577200e3b39ef5d63d57176c2b66b278acd https://github.com/usnistgov/iheos-toolkit2/commit/9b454577200e3b39ef5d63d57176c2b66b278acd

Tests which have incorrect v3 namespace but should be 2.1 now correctly declare 2.1 namespace.

If other tests need upgraded metadata files or namespace fixes, the gov.nist.toolkit.testengine.engine.ErrorScan#main method tool can be used to identify namespace problems that the schema validator catches. Next, the gov.nist.toolkit.xdstools2.server.MetadataCollectionToMetadata#main method can be used to upgrade or convert the metadata. A bulk update can be done using both the ErrorScan running in bulkParameter mode and MetadataCollectionToMetadata bulk update mode.