NASA-PDS / validate

Validates PDS4 product labels, data and PDS3 Volumes
https://nasa-pds.github.io/validate/
Apache License 2.0
15 stars 11 forks source link

validate does not allow namespace starting with https:// #489

Closed rchenatjpl closed 2 years ago

rchenatjpl commented 2 years ago

Am I wrong? In xml, namespaces are allowed to begin https://... Attachment co1.xml is a trimmed version of a file I'm reviewing. It really has xmlns:epn="https://voparis-ns.obspm.fr/... The .xsd and .sch use the same weird namespace - check https://voparis-ns.pages.obspm.fr/pds4/epn/v1/VESPA_EPN_1A00.xsd and sch

validate complains.

% validate -t co1.xml
[snip]
Product Level Validation Results
  FAIL: file:/Users/rchen/Desktop/co1.xml
      WARNING  [warning.label.schema]   line 66, 43: schema_reference.4: Failed to read schema document 'https://voparis-ns.pages.obspm.fr/pds4/epn/v1/VESPA_EPN_1A00.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
      ERROR  [error.label.schema]   line 66, 43: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'epn:VESPA_EPNcore_Parameters'.
      WARNING  [warning.label.schema]   line 67, 34: schema_reference.4: Failed to read schema document 'https://voparis-ns.pages.obspm.fr/pds4/epn/v1/VESPA_EPN_1A00.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
...

To show the problem is the weird namespace, validate the attached co2.xml

% diff co1.xml co2.xml
4c4
< <?xml-model href="https://voparis-ns.pages.obspm.fr/pds4/epn/v1/VESPA_EPN_1A00.sch" 
---
> <?xml-model href="http://voparis-ns.pages.obspm.fr/pds4/epn/v1/VESPA_EPN_1A00.sch" 
9c9
<    xmlns:epn="https://voparis-ns.obspm.fr/pds4/epn/v1"
---
>    xmlns:epn="http://voparis-ns.obspm.fr/pds4/epn/v1"
12c12
<       https://voparis-ns.obspm.fr/pds4/epn/v1 https://voparis-ns.pages.obspm.fr/pds4/epn/v1/VESPA_EPN_1A00.xsd
---
>       http://voparis-ns.obspm.fr/pds4/epn/v1 https://voparis-ns.pages.obspm.fr/pds4/epn/v1/VESPA_EPN_1A00.xsd

To test validate on the normal namespace, I downloaded and modified the .sch and .xsd to use the normal namespace as well. They're attached as VES.. The PDS4_PDS_1H00. are attached as P.*. Then

% validate -x *.xsd -S *.sch -t co2.xml
[snip]
   Targets                       [file:/Users/rchen/Desktop/co2.xml]
   User Specified Schemas        [file:/Users/rchen/Desktop/P.xsd, file:/Users/rchen/Desktop/VES.xsd]
   User Specified Schematrons    [file:/Users/rchen/Desktop/P.sch, file:/Users/rchen/Desktop/VES.sch]
   Severity Level                WARNING
   Recurse Directories           true
   File Filters Used             [*.xml, *.XML]
   Data Content Validation       on
   Product Level Validation      on
   Max Errors                    100000
   Registered Contexts File      /Users/rchen/PDS4tools/validate/resources/registered_context_products.json
Product Level Validation Results
  PASS: file:/Users/rchen/Desktop/co2.xml
        1 product validation(s) completed

Archive.zip

Engineering Details

Per initial triage, it appears their is an issue with the SSL certificates at sslpoke.java.txt sslpoke.py.txt https://voparis-ns.obspm.fr/, the following Python and Java snippets both raise errors.

rchenatjpl commented 2 years ago

Please answer quickly whether xml namespaces must be http://... If they must, I'll write that in my review. If not, I'll still suggest they change over. Thanks. I don't badly need validate to be fixed.

jordanpadams commented 2 years ago

@rchenatjpl doubtful, but I will check. I will poke at this today and hopefully have an answer for you by end lunchtime

jordanpadams commented 2 years ago

per some offline discussions, this was an HTTPS certificate issue, not a validate issue. that issue has been fixed and these products validate as expected