Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.7
    • Component/s: None
    • Labels:
      None
    • Environment:

      no special issues

      Description

      It would be nice if you can set a self defined schema or better a schema file to validate a XML-file that has no schema defined in its source.

      I would be happy with something like XMLConfiguratiom.setSchema(java.io.File schemaFile) or XMLConfiguration.setSchema(javax.xml.validation.Schema schema) that is forwarded to the XML-parser used by XMLConfiguration.

      Thanks alot...

        Activity

        Hide
        Oliver Heger added a comment -

        Extended support for schema validation seems to be available in Java since the 1.5 release. However ATM our minimum required JDK is still 1.3. Do you know whether it is possible to perform schema validation in this version in a portable way? Otherwise this feature will have to wait until we drop the JDK 1.3 compatibility and move on to 1.5.

        Show
        Oliver Heger added a comment - Extended support for schema validation seems to be available in Java since the 1.5 release. However ATM our minimum required JDK is still 1.3. Do you know whether it is possible to perform schema validation in this version in a portable way? Otherwise this feature will have to wait until we drop the JDK 1.3 compatibility and move on to 1.5.
        Hide
        Emmanuel Bourg added a comment -

        We could implement a setSchema(URL url, String language) method using reflection, and maybe a setSchema(Object) method accepting only a Schema instance.

        Anyone has an example of schema that would help us building a test case ?

        Show
        Emmanuel Bourg added a comment - We could implement a setSchema(URL url, String language) method using reflection, and maybe a setSchema(Object) method accepting only a Schema instance. Anyone has an example of schema that would help us building a test case ?
        Hide
        Ralph Goers added a comment -

        I have enhanced XMLConfiguration to perform schema validation using the schemaLocation in XML document. I tested this on Java 1.3 with no problems as long as xerces was present. Once I get appropriate Jira permissions I will assign this to myself and update the issue as appropriate.

        Show
        Ralph Goers added a comment - I have enhanced XMLConfiguration to perform schema validation using the schemaLocation in XML document. I tested this on Java 1.3 with no problems as long as xerces was present. Once I get appropriate Jira permissions I will assign this to myself and update the issue as appropriate.
        Hide
        Ralph Goers added a comment -

        I have modified save() so that if schemaValidation is set the document will be validated before saving.

        Show
        Ralph Goers added a comment - I have modified save() so that if schemaValidation is set the document will be validated before saving.

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Andre Pietsch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development