You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2018/12/17 11:10:00 UTC

[jira] [Created] (OFBIZ-10718) Use namespaces instead of ShemaLocation and noNamespaceSchemaLocation

Jacques Le Roux created OFBIZ-10718:
---------------------------------------

             Summary: Use namespaces instead of ShemaLocation and noNamespaceSchemaLocation
                 Key: OFBIZ-10718
                 URL: https://issues.apache.org/jira/browse/OFBIZ-10718
             Project: OFBiz
          Issue Type: Improvement
          Components: ALL COMPONENTS
    Affects Versions: Trunk
            Reporter: Jacques Le Roux
             Fix For: Upcoming Branch


As suggested by [~paul_foxworthy] at bottom of OFBIZ-6807
{quote}
ShemaLocation and noNamespaceSchemaLocation are hacks. It is silly to expect an XML document to know the right place for its schema. So its good that you removed schemaLocation from the webapp files.

However, there are still thousands of noNamespaceSchemaLocation in other XML files.

What the XML files should have is a namespace. Then external tools can map from the namespace to a catalogue of schemas to validate elements within those namespaces.

I suspect the noNamespaceSchemaLocation attributes are there because people were used to SGML and SGML-like documents (including HTML) having a DOCTYPE that refers to a location for a DTD. With experience, that has turned out to be a mistake - note in HTML5 you just say "it's HTML", no mention of a DTD.

So if you're doing anything to improve XML files, I suggest you include a namespace instead of schemaLocation and noNamespaceSchemaLocation. XML validators and IDEs like IntelliJ IDEA and Eclipse can find the right schema based on the namespace.
{quote}

{quote}
The Eclipse catalogs may not work for other IDEs, so we may need to maintain several versions. It shouldn't be too hard because we won't be defining new XML schemas and namespaces very often. Mostly we'd just change details within them, and that won't affect the catalog or catalogs.
{quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)