Uploaded image for project: 'JDO'
  1. JDO
  2. JDO-472

Cannot use JDO 2 xsd for XML validation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • JDO 2 final (2.0)
    • None
    • None

    Description

      I am trying to use the last JDO 2.0 xsd with:

      SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
      URL xsdURL = getClass().getResource("/jdo_2.0.xsd");
      Schema schema = factory.newSchema(xsdURL);

      First I got the following exception (from newSchema):

      org.xml.sax.SAXParseException: cos-nonambig: "http://java.sun.com/xml/ns/jdo/jdo":extension and "http://java.sun.com/xml/ns/jdo/jdo":extension (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles.

      And after trying to fix it, I got the following exception (from newSchema):

      org.xml.sax.SAXParseException: src-resolve.4.2: Error resolving component 'xs:attlist.jdo'. It was detected that 'xs:attlist.jdo' is in namespace 'http://www.w3.org/2001/XMLSchema', but components from this namespace are not referenceable from schema document 'file:/D:/odb/dv/rt/class/jdo.xsd'. If this is the incorrect namespace, perhaps the prefix of 'xs:attlist.jdo' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/D:/odb/dv/rt/class/jdo.xsd'.

      The same 3 lines work well with JPA 1.0 xsd. Has anyone used JDO 2.0 xsd successfully already?

      Attachments

        1. xsd-test.zip
          5 kB
          Ilan Kirsh
        2. JDO472-mbo-070527.patch
          111 kB
          Michael Bouschen

        Activity

          People

            mbo Michael Bouschen
            kirsh Ilan Kirsh
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: