Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2126

XML Catalog uri should use the same semantics as import/include schemaLocation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0
    • Front End
    • None

    Description

      When an import/include namespces resolves to a name in an XML ctalog, we do not do any further processing of the URI in the ctalog. We just treat it as a URI. For relative paths, that means we'll endup looking relative to the current working directory. This should probably use the same semantics as the schemaLocation attribute in include/import, allowing it to resolve to jars on the classpath and other semantics that uses.

      Additionally, resovleResource in DaffodilXMLLoader.scala has teh following code:

      case Some(uri) => {
        val resourceAsStream =
          try {
            uri.toURL.openStream() // This will work.
          } catch {
            case e: java.io.IOException => Assert.invariantFailed("found resource but couldn't open")
          }
      }
      

      There are plenty of valid reasons for openStream to fail. The most common being a URI specific in the XML catalog doesn't exist. By making this an assert, it makes it difficult to figure out why the stream failed to open. We should instead convert this IOException to an SDE so the user will have some idea of what went wrong.

      Attachments

        Activity

          People

            slawrence Steve Lawrence
            slawrence Steve Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: