Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.7, 1.1, 1.1.1, 1.1.2, 1.1.2.1, 1.2
    • Fix Version/s: 1.3 rc1
    • Component/s: XML code generator
    • Labels:
      None
    • Number of attachments :
      10

      Description

      "XML Schema Part 2: Datatypes Second Edition" document (http://www.w3.org/TR/xmlschema-2/) specifies validity constraints on facets. For example: "It is an error for both minInclusive and minExclusive to be specified for the same datatype."
      These constraints need to be checked during schema validation and generation must be aborted when the constraints are violated.

      1. patch.txt
        66 kB
        Sergei Ivanov
      2. patch.c1107.tests.20061108.txt
        7 kB
        Werner Guttmann
      3. Clean-up.patch
        5 kB
        Sergei Ivanov
      4. patch.c1107.20080302.txt
        103 kB
        Werner Guttmann
      5. patch.c1107.20080311.txt
        104 kB
        Werner Guttmann

        Issue Links

          Activity

          Hide
          Werner Guttmann added a comment -

          Looking at this again, how about the logic that exists within SimpleType.isNumericType() that deals with base types ?

              /**
               * Indicates whether this {@link SimpleType} is a numeric type.
               * @return True if this SimpleType is a numeric type
              **/
              public boolean isNumericType() {
                  SimpleType toStart = this;
                  while (!toStart.isBuiltInType()) {
                      toStart = (SimpleType) toStart.getBaseType();
                  }
                  return SimpleTypesFactory.isNumericType(toStart.getTypeCode());
              }
          

          Where should this go in your opinion ?

          Show
          Werner Guttmann added a comment - Looking at this again, how about the logic that exists within SimpleType.isNumericType() that deals with base types ? /** * Indicates whether this {@link SimpleType} is a numeric type. * @return True if this SimpleType is a numeric type **/ public boolean isNumericType() { SimpleType toStart = this; while (!toStart.isBuiltInType()) { toStart = (SimpleType) toStart.getBaseType(); } return SimpleTypesFactory.isNumericType(toStart.getTypeCode()); } Where should this go in your opinion ?
          Hide
          Sergei Ivanov added a comment -

          How about this:

          /* SimpleType */
              public boolean isNumericType() {
                  if (!isBuiltInType()) {
                      return ((SimpleType) getBaseType()).isNumericType();
                  }
                  return false;
              }
          

          overridden as

              public boolean isNumericType() {
                  return true;
              }
          

          in DecimalType and RealType.

          Show
          Sergei Ivanov added a comment - How about this: /* SimpleType */ public boolean isNumericType() { if (!isBuiltInType()) { return ((SimpleType) getBaseType()).isNumericType(); } return false ; } overridden as public boolean isNumericType() { return true ; } in DecimalType and RealType.
          Hide
          Werner Guttmann added a comment -

          Very reasonable .. and far better than pulling this logic outside of SimpleType, as I was considering. I guess I will commit this patch (post this small change) , and work with change requests from here.

          Show
          Werner Guttmann added a comment - Very reasonable .. and far better than pulling this logic outside of SimpleType, as I was considering. I guess I will commit this patch (post this small change) , and work with change requests from here.
          Hide
          Werner Guttmann added a comment -

          Updated and final patch.

          Show
          Werner Guttmann added a comment - Updated and final patch.
          Hide
          Sergei Ivanov added a comment -

          I am really glad that this change will finally go live (this defect probably has one of the longest lifespans in the project!). This is a good starting point for further enhancements in the area and I hope I'll be able to contribute again. Many thanks, Werner.

          Show
          Sergei Ivanov added a comment - I am really glad that this change will finally go live (this defect probably has one of the longest lifespans in the project!). This is a good starting point for further enhancements in the area and I hope I'll be able to contribute again. Many thanks, Werner.

            People

            • Assignee:
              Werner Guttmann
              Reporter:
              Sergei Ivanov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: