Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-10718

Use namespaces instead of ShemaLocation and noNamespaceSchemaLocation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Trunk, Upcoming Branch
    • None
    • ALL COMPONENTS
    • None

    Description

      As suggested by paul_foxworthy at bottom of OFBIZ-6807

      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.

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jleroux Jacques Le Roux
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: