Book a Demo

Author Topic: Import XSD with Relative Paths  (Read 5950 times)

asanh

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Import XSD with Relative Paths
« on: January 31, 2009, 06:28:18 am »
I am importing an xsd into EA to generate class diagrams. This xsd imports and/or includes other xsd's, which in turn import and/or include other xsd's. The schemaLocation attributes of these imports and includes have relative path values. For example:

a.xsd in e:\dirA referenced by c.xsd in e:\dirA\dirB\dirC would have an attribute value of "../../a.xsd"

I find that EA is reporting errors for these values. For example:

e:\dirA\dirB\e:\dirA\a.xsd cannot be found

But if I modify the xsd's to use absolute paths, "e:\dirA\a.xsd", for instance, the import is successful.

The user guide notes that the schemaLocation value needs to resolve to the xsd's location and not a URL, but I have not been able to locate any discussion of whether a relative path is allowed.

I'd appreciate any insight as to whether I can use relative path values, and if I can, how I might successfully use them.

Thanks for your help.

Neal Tovsen

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Import XSD with Relative Paths
« Reply #1 on: February 14, 2009, 07:38:20 am »
I've encountered the same problem, and would very much like to find out if this can be done.

In my case (importing Open Geospatial Consortium standard) the graph of XSD schema documents is very large. Changing each individual .xsd file to use absolute paths would be incredibly time consuming!

asanh

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Import XSD with Relative Paths
« Reply #2 on: March 11, 2009, 03:41:44 am »
I haven't received any response other than yours.

I, too, was working with OGC xsd's. But I did go and change all the xsd's. That was how I was able to confirm for myself that that was what EA wanted.

An add-on to my initial query: Does EA provide for an XML catalog? That would be an alternative solution.

Neal Tovsen

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Import XSD with Relative Paths
« Reply #3 on: April 07, 2009, 07:59:23 am »
Just following up on this. I filed a bug with Sparx support on March 11. They confirmed the behavior we were seeing: EA was not properly resolving relative paths above the current directory (i.e., it would do "./foo.xsd", but not "../../foo.xsd"). They promised it would be fixed in the next build.

Fortunately, I had a few weeks of lead time before my project would really require me to start getting down to the gory details of the OGC schema. So I decided to wait a bit.

Just noticed there was a new build available, so I downloaded it and tried again. Looks good so far!

Updating all of the OGC XSDs to operate off of one schema root did NOT look like fun at all...it's a very big schema! I'm very glad not to have needed to do that. Still haven't looked at it in detail, but so far so good. Thanks guys.   8-)

Neal
« Last Edit: April 07, 2009, 08:03:23 am by ntovsen »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Import XSD with Relative Paths
« Reply #4 on: April 07, 2009, 10:51:36 pm »
Thanks for the progress report Neal. Please post back when you've given it a more thorough workout and let us know if EA continues to handle this correctly. [I'd hate to reopen some of my XML files...]
No, you can't have it!