Skip to content

Support for XSD (XML Schema) 1.1 #1401

Closed

Description

@mlocati

What about adding support for XSD 1.1?
AFAIK xerces is the only open source library that supports it (provided that we use the version marked with "XML Schema 1.1").

Activity

  1. mickaelistria commented on Nov 16, 2023

    @mickaelistria
    Contributor

    Wild Web Developer delegates all XML smartness to LemMinX language server. So there is nothing Wild Web Developer can do well about this issue; please report it to LemMinX project.

  2. mlocati commented on Nov 16, 2023

    @mlocati
    Author

    Just an update: there's already a pull request in LemMinX (see eclipse-lemminx/lemminx#515), but it's being blocked (mainly) because there's no xerces XSD 1.1 version published on Maven (see https://issues.apache.org/jira/browse/XERCESJ-1736 about that).

  3. angelozerr commented on Nov 16, 2023

    @angelozerr
    Contributor

    Indeed but the main problem is that the Xerces XSD 1.1 is an old Xerces version and doesn't integrate the Xerces master fixes/improvements. (It is an old version of Xerces).

  4. mlocati commented on Nov 16, 2023

    @mlocati
    Author

    Xerces XSD 1.1 is an old Xerces version

    Are you sure? From the download page I see that the latest version (2.12.2) is also available in the "XSD 1.1" variant.

  5. angelozerr commented on Nov 16, 2023

    @angelozerr
    Contributor

    Are you sure?

    It was a long time that I try it but if I remember the code base is different from the standard Xerces

  6. mlocati commented on Nov 16, 2023

    @mlocati
    Author

    the code base is different from the standard Xerces

    I've just checked it with:

    $ curl -sSLf https://dlcdn.apache.org//xerces/j/source/Xerces-J-src.2.12.2.tar.gz | tar xz
    $ curl -sSLf https://dlcdn.apache.org//xerces/j/source/Xerces-J-src.2.12.2-xml-schema-1.1.tar.gz | tar xz
    $ diff -ru xerces-2_12_2 xerces-2_12_2-xml-schema-1.1 >differences.patch

    At a first glance of the differences.patch file) it seems that the "XSD 1.1" version is in sync with the "base" one.

    I also tried checking the commits:

    $ svn log --limit 20 https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_2_12_2 \
       | sed -E 's/^xercesj( commit)? *[,:] *//' \
       | cut -c -50 \
       >base.log
    $ svn log --limit 20 https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_2_12_2-xml-schema-1.1 \
       | sed -E 's/^xercesj( commit)? *[,:] *//' \
       | cut -c -50 \
       >xsd11.log

    And it seems they are commiting the fixes of the "base" version to the "XSD 1.1" version:

    base.log xsd11.log
    --------------------------------------------------
    r1897279 | mukulg | 2022-01-21 01:05:01 +0100 (Fri
    
    Tagging Xerces-J 2.12.2.
    --------------------------------------------------
    r1897274 | mukulg | 2022-01-21 00:56:15 +0100 (Fri
    
    updating copyright year, for 2.12.2 release
    --------------------------------------------------
    
    
    
    
    r1897227 | mukulg | 2022-01-20 05:44:56 +0100 (Thu
    
    making few minor changes to, documentation meta da
    --------------------------------------------------
    r1897204 | mukulg | 2022-01-19 14:02:30 +0100 (Wed
    
    making few minor changes to, documentation meta da
    --------------------------------------------------
    r1897202 | mukulg | 2022-01-19 13:41:53 +0100 (Wed
    
    making few minor changes to, documentation meta da
    --------------------------------------------------
    r1897201 | mukulg | 2022-01-19 13:23:24 +0100 (Wed
    
    making changes to, documentation meta data files, 
    --------------------------------------------------
    r1897159 | mrglavas | 2022-01-17 21:48:22 +0100 (M
    
    Treat carriage return as a regular content charact
    --------------------------------------------------
    
    
    
    
    r1897142 | mukulg | 2022-01-17 06:27:13 +0100 (Mon
    
    committing few classpath modifications
    --------------------------------------------------
    r1897141 | mrglavas | 2022-01-17 06:15:19 +0100 (M
    
    Adding a required boundary check when a carriage r
    --------------------------------------------------
    r1896383 | mukulg | 2021-12-25 12:33:59 +0100 (Sat
    
    committing new xml-apis.jar and resolver.jar files
    --------------------------------------------------
    r1896370 | mukulg | 2021-12-25 05:55:23 +0100 (Sat
    
    upgrading xalanj dependencies to 2.7.2
    --------------------------------------------------
    r1895283 | mukulg | 2021-11-24 10:08:09 +0100 (Wed
    
    committing fix for jira issue XERCESJ-1732. xpath 
    --------------------------------------------------
    r1894472 | mukulg | 2021-10-22 12:17:43 +0200 (Fri
    
    committing fix for jira issue XERCESJ-1731
    --------------------------------------------------
    r1894284 | mukulg | 2021-10-15 10:57:32 +0200 (Fri
    
    minor changes to xercesj docs
    --------------------------------------------------
    r1893395 | mukulg | 2021-09-17 07:48:18 +0200 (Fri
    
    minor improvements to xercesj docs
    --------------------------------------------------
    r1891772 | mukulg | 2021-07-24 13:51:11 +0200 (Sat
    
    committing fix for jira issue XERCESJ-1729
    --------------------------------------------------
    r1890048 | mukulg | 2021-05-20 15:51:55 +0200 (Thu
    
    minor changes to xercesj docs, as per user request
    --------------------------------------------------
    r1883717 | mukulg | 2020-11-22 07:10:40 +0100 (Sun
    
    minor improvements to xercesj documentation text
    --------------------------------------------------
    r1880038 | mukulg | 2020-07-19 09:54:00 +0200 (Sun
    
    minor improvements to xerces-j docs generator styl
    --------------------------------------------------
    r1879853 | mukulg | 2020-07-14 11:34:37 +0200 (Tue
    
    committing minor changes to xerces-j docs meta dat
    --------------------------------------------------
    
    --------------------------------------------------
    r1897280 | mukulg | 2022-01-21 01:05:52 +0100 (Fri
    
    Tagging Xerces-J 2.12.2 XML Schema 1.1.
    --------------------------------------------------
    r1897274 | mukulg | 2022-01-21 00:56:15 +0100 (Fri
    
    updating copyright year, for 2.12.2 release
    --------------------------------------------------
    r1897231 | mukulg | 2022-01-20 07:09:21 +0100 (Thu
    
    minor correction to xml schema 1.1 build file
    --------------------------------------------------
    r1897227 | mukulg | 2022-01-20 05:44:56 +0100 (Thu
    
    making few minor changes to, documentation meta da
    --------------------------------------------------
    r1897204 | mukulg | 2022-01-19 14:02:30 +0100 (Wed
    
    making few minor changes to, documentation meta da
    --------------------------------------------------
    r1897202 | mukulg | 2022-01-19 13:41:53 +0100 (Wed
    
    making few minor changes to, documentation meta da
    --------------------------------------------------
    r1897201 | mukulg | 2022-01-19 13:23:24 +0100 (Wed
    
    making changes to, documentation meta data files, 
    --------------------------------------------------
    r1897160 | mrglavas | 2022-01-17 21:50:35 +0100 (M
    
    Treat carriage return as a regular content charact
    --------------------------------------------------
    r1897143 | mrglavas | 2022-01-17 06:32:10 +0100 (M
    
    Adding a required boundary check when a carriage r
    --------------------------------------------------
    r1897142 | mukulg | 2022-01-17 06:27:13 +0100 (Mon
    
    committing few classpath modifications
    --------------------------------------------------
    r1896836 | mukulg | 2022-01-08 13:55:20 +0100 (Sat
    
    minor refactoring and improvements to comments
    --------------------------------------------------
    r1896825 | mukulg | 2022-01-08 08:44:06 +0100 (Sat
    
    committing fix for jira issue XERCESJ-1726. now wi
    --------------------------------------------------
    r1896596 | mukulg | 2022-01-01 13:26:23 +0100 (Sat
    
    minor improvements to implementations of, xml sche
    --------------------------------------------------
    r1896585 | mukulg | 2022-01-01 05:39:11 +0100 (Sat
    
    minor documentation correction
    --------------------------------------------------
    r1896383 | mukulg | 2021-12-25 12:33:59 +0100 (Sat
    
    committing new xml-apis.jar and resolver.jar files
    --------------------------------------------------
    r1896370 | mukulg | 2021-12-25 05:55:23 +0100 (Sat
    
    upgrading xalanj dependencies to 2.7.2
    --------------------------------------------------
    r1896277 | mukulg | 2021-12-22 15:01:53 +0100 (Wed
    
    implemented xpath 2.0 regex multi-character escape
    --------------------------------------------------
    r1896272 | mukulg | 2021-12-22 12:37:27 +0100 (Wed
    
    improving an earlier test case. also committing im
    --------------------------------------------------
    r1896245 | mukulg | 2021-12-21 14:23:55 +0100 (Tue
    
    minor improvements to xpath 2.0 regex unicode supp
    --------------------------------------------------
    r1896156 | mukulg | 2021-12-19 13:19:57 +0100 (Sun
    
    minor improvements to XML Schema 1.1 xpath 2.0 reg
    --------------------------------------------------
    
  7. angelozerr commented on Nov 16, 2023

    @angelozerr
    Contributor

    Thanks @mlocati for your fedback! We need to find time to re-investigate this XSD 1.1 support from Xerces.

  8. mlocati commented on Nov 16, 2023

    @mlocati
    Author

    That'd be very nice... so far, the only free (but not open source) alternative supporting XSD 1.1 I was able to find is Liquid Studio with the Free Community License. And it seems it uses xerces under the hood: here's what I see when I open an XSD 1.1:

    immagine

  9. angelozerr commented on Nov 16, 2023

    @angelozerr
    Contributor

    The only problem is that Xerces XSD 1.1 is not published in maven repository central, why?

  10. mlocati commented on Nov 16, 2023

    @mlocati
    Author

    The only problem is that Xerces XSD 1.1 is not published in maven repository central, why?

    Who knows... see https://issues.apache.org/jira/browse/XERCESJ-1736

  11. mlocati commented on Nov 18, 2023

    @mlocati
    Author

    The only problem is that Xerces XSD 1.1 is not published in maven repository central

    @angelozerr And it's not a big problem. I've just managed to use the "XSD 1.1" variant in a maven project.
    The trick is to manually download the Xerces archive and install the contained jar files in the local M2 reposoritory with mvn install:install-file.
    And it works!

    For a working example, you can take a look a the

    1. this script install Xerces with XSD 1.1 support (and its dependencies) in the local M2 repository
    2. this pom use those JARs
    3. this line tells Java to use the XSD 1.1 Schema Factory
    4. these lines actually load a XSD 1.1 Schema

    And everything seems to be working: I'm able to use a rather complex XSD 1.1 Schema to validate a few XML files.

  12. mlocati commented on Nov 18, 2023

    @mlocati
    Author

    this line tells Java to use the XSD 1.1 Schema Factory

    I think it's optional: I've just tried omitting it, and everything worked like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions