Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6493687

validator.validate(new DOMSource(node)) throws SAXException with jaxp 1.4

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 2.0
    • 6
    • xml

      Reported on java.net: https://jaxp.dev.java.net/issues/show_bug.cgi?id=11

      i just made my first steps with jre 1.6b2 and found the following problem:

            validator.validate(new DOMSource(node));

      always throws a SAXException ("cannot find the declaration of element ROOT")
      this happens in all my programs where i try to validate a xml file with a schema
      xsd file ...

      but this does not happen with jre 1.5 or jre 1.4.2_12 (jaxp 1.3.2 endorsed) or
      even with jre 1.6b2 (jaxp 1.3.2 endorsed)
      On further examination it turned out that the commenter was attempting to validate documents parsed with namespace support turned off. Namespace support is a prerequisite of XML Schema validation. Turning on namespace support made the bug go away.

      So the real bug is that it ever worked at all in 1.3, but I'm not going to go chasing that one.

            nwalshsunw Norman Walsh (Inactive)
            nwalshsunw Norman Walsh (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: