modelica / fmi-standard

Specification of the Functional Mock-up Interface (FMI)

Home Page:https://fmi-standard.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

KarlWernersson opened this issue · comments

Hi

I got some complains about that the Dymola FMU's contains
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

Do we have some XML/XSD Guru that can explain well why this isn't an issue so I can refer complains to this ticket?
Maybe @pmai ?

Since you asked: the xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" is a declaration of a namespace (binding), as per Section 3 of the Namespaces in XML 1.1 (Second Edition) W3C Recommendation . As such it is not considered an attribute, but rather a namespace attribute of the containing element, as per Section 2.2 of the XML Information Set (Second Edition) W3C Recommendation, on which XML Schema is based. Namespace attributes are not constrained by XML Schema, see inter-alia Section 3.2.1 of W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures, or Section 3.3.4.4 as well as Section 3.4.4.2.

Furthermore, XML Schema instances are explicitly allowed to contain the attributes xsi:schemaLocation or xsi:noNamespaceSchemaLocation in all elements, as per Section 3.3.4.4 and Section 3.4.4.2.

So in summary this is not only allowed, but rather suggested by XML Schema in combination with XML Namespaces and XML Infoset.

Should we recommenend adding the namespace attribute and update the examples accordingly?

Should we recommenend adding the namespace attribute and update the examples accordingly?

I don't think so: Giving a schema location would only help people manually editing modelDescription.xml files, without being sophisticated enough to manually assign the proper schema. That is not a use case that we as a whole community should worry about supporting. It is fine that tools can do this if they want to, and the more common case is likely for manually generated modelDescription files, e.g. in build pipelines for manually coded FMUs, where the author might want to do that. So I see no need to state anything on this one way or another.

Thanks @pmai =)