0

I'm currently working on a project where we need xmlmime.xsd

This schema, coming from w3.org, looks like this (only parts include, because the rest is not relevant to the question)

<xs:schema targetNamespace="http://www.w3.org/2005/05/xmlmime">
    <xs:attribute name="contentType">
    <xs:simpleType>
        <xs:restriction base="xs:string">
            <xs:minLength value="3"/>
        </xs:restriction>
        </xs:simpleType>
    </xs:attribute>
<!-- and so on -->

Now if I try to validate this file with an online validator or within JetBrains Rider IDE both complain Namespace "xs" is not bound

When I include xmlns:xs="http://www.w3.org/2005/05/xmlmime in the first line, both tools are happy and state the xsd is valid. Same happens if I remove the namespace (all xs: prefixes) completely.

After some reading (e.g. What is the difference between targetNamespace and xmlns:target?) the error makes sense to me, because I use a namespace which is not defined.

This leads to my question.

Is the xmlmime.xsd provided by w3.org really invalid or am I missing something?

Arikael
  • 1,989
  • 1
  • 23
  • 60
  • Use view-source in Mozilla to view the original XML document and not the attempt at pretty printing with an XSLT that drops namespace declarations due to shortcomings in the namespace axis support in XSLT in Mozilla. – Martin Honnen Jan 10 '22 at 12:38

1 Answers1

0

ok, this is kinda silly but I leave the question so maybe other people won't fall for the same.

Everything is fine with the xsd. The problem is how Firefox displays the file and that I just copied the displayed XML.
If you open the source (CTRL-U in Windows) you will see that everything is there

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
           targetNamespace="http://www.w3.org/2005/05/xmlmime" >

But Firefox just omits the xmlns attributes.
Chrome display the file as it is.

EDIT: And here is the 20 years(!) old and still open bug report -> https://bugzilla.mozilla.org/show_bug.cgi?id=175946

Arikael
  • 1,989
  • 1
  • 23
  • 60