XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Vinayak SapreSubject: Cyclic import in schema
Author: Vinayak Sapre
Date: 22 Feb 2003 04:09 AM
Is it legal to import schema two.xsd in one.xsd when one.xsd imports two.xsd.

1. Create a project in SS add one.xsd and two.xsd attached to this post.
2. Open two.xsd and click button to validate the schema. It says it's valid.
3. Now open one.xsd and click button to validate schema. It says 1 error in two.xsd.


Logically what I want to do is correct. One.xsd defines BookName type. Two.xsd uses that type to define Book.


Documenttwo.xsd


Documentone.xsd

Postnext
Vinayak SapreSubject: Cyclic import in schema
Author: Vinayak Sapre
Date: 22 Feb 2003 04:56 AM
I have also observed that the error occurs only if there is a global type in two.xsd that uses global type from one.xsd. To be more precise if I comment out the complextype definition Book in two.xsd and add instead







it validates both schemas. The local type of testbook is same as global type Book.

Postnext
Vinayak SapreSubject: Cyclic import in schema
Author: Vinayak Sapre
Date: 22 Feb 2003 05:00 AM
The sample code got lost in my second message. See attached file for code.


Documenttwo(1).xsd

Postnext
Alberto MassariSubject: Re: Cyclic import in schema
Author: Alberto Massari
Date: 24 Feb 2003 04:22 AM
Hi Vinayak,
At 04.28 22/02/2003 -0500, you wrote:
>Is it legal to import schema two.xsd in one.xsd when one.xsd imports two.xsd.
>[...]

Yes, the schema is legal, and Stylus validates fine. As you are getting an
error, I guess you are running a version of Stylus older than 4.5 bl103l.
Can you try updating your version to the latest one (4.5bl103q, available
from http://www.stylustudio.com/update section "4.x Updates") and try again?

Thanks,
Alberto


Postnext
Vinayak SapreSubject: Re: Cyclic import in schema
Author: Vinayak Sapre
Date: 25 Feb 2003 03:37 PM
I believe I am using latest version 4.6, build 103q. See attached image of about box.

Also the link that you mention is not valid.


ImageSSAbout.gif
About Box

Postnext
Minollo I.Subject: Re: Cyclic import in schema
Author: Minollo I.
Date: 25 Feb 2003 03:46 PM
Yes, you are running 103q, which is the latest version.
For future reference, the correct link Alberto was mentioning is:
http://www.stylusstudio.com/update

We will investigate your problem further and let you know.
Thanks,
Minollo

Postnext
Vinayak SapreSubject: Cyclic import in schema
Author: Vinayak Sapre
Date: 25 Feb 2003 04:27 PM
Sorry for too many replies. But I thought I should also include image of error.

Would it be possible to cc the reply to my email?


ImageSSError.gif
Error Message

Postnext
Alberto MassariSubject: Re: Cyclic import in schema
Author: Alberto Massari
Date: 26 Feb 2003 06:20 AM
Sorry for my first answer (I didn't read you message too carefully, so I
only tried validating two.xsd...)
I submitted your testcase to the Xerces team as bug #17425
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17425).
If you want, from that page you can add your e-mail to receive the
notifications regarding the bug.

Sorry for the previous misunderstanding,
Alberto

Postnext
Alberto MassariSubject: Re: Cyclic import in schema
Author: Alberto Massari
Date: 27 Feb 2003 09:05 AM
The Xerces team has been pretty fast on this issue...

The fix for this problem will be available in the next update.

Alberto

Postnext
Alberto MassariSubject: Re: Cyclic import in schema
Author: Alberto Massari
Date: 03 Mar 2003 12:11 PM
A fix for this problem is now available in 4.5 BL103r. You can download the
updated build from:
http://www.stylusstudio.com/update (4.x section)

Thanks for reporting this,
Alberto

Postnext
Vinayak SapreSubject: Cyclic import in schema
Author: Vinayak Sapre
Date: 24 Mar 2003 03:04 PM
I think the issue is partially fixed. If the schemalocation is a URL it still gives error.

This is what I tried
1. I made sure that the two files, one.xsd and two.xsd, attached to my original email validate correctly.
2. I copied these files on docroot of my local webserver.
3. Changed schemaLocation to http://localhost/one.xsd and http://localhost/two.xsd.

The two.xsd validates okay. But One.xsd says there errors in two.xsd.

Postnext
Alberto MassariSubject: Re: Cyclic import in schema
Author: Alberto Massari
Date: 25 Mar 2003 12:01 PM
Hi Vinayak,

At 15.23 24/03/2003 -0500, you wrote:
>From: "Vinayak Sapre"
>
>I think the issue is partially fixed. If the schemalocation is a URL it
>still gives error.
>
>This is what I tried
>1. I made sure that the two files, one.xsd and two.xsd, attached to my
>original email validate correctly.
>2. I copied these files on docroot of my local webserver.
>3. Changed schemaLocation to http://localhost/one.xsd and
>http://localhost/two.xsd.
>
>The two.xsd validates okay. But One.xsd says there errors in two.xsd.

I tried doing as you say, but I am able to validate both of them; I
followed the following steps:
- installed Apache 2.0.44 on the local machine (Windows XP), listening on
port 8080
- copied the original one.xsd and two.xsd to the folder mapped to the web root
- opened Stylus, and loaded both file using the URLs
http://localhost:8080/one.xsd and http://localhost:8080/two.xsd
- validation succeeds for both files, even without changing the xsd:import
statement (it uses a relative path, so the other schema can be found)

- I tried changing the server port to 80, and opening
http://localhost/one.xsd and http://localhost/two.xsd, but validation still
succeeds

- I edited the files to use the full URLs in their import statements
(instead of just the relative name), and they still succeeds

So, I guess that you are opening one.xsd inside Stylus using the file
system path (e.g. "C:\webroot\one.xsd"), while using the web server URLs
inside the xsd:import statement; in this case, the Xerces validator cannot
detect the cyclic import, because what it sees is c:\webroot\one.xsd ->
http://localhost/two.xsd -> http://localhost/one.xsd

If this is the case, you should open the documents inside Stylus using the
web server URLs

Hope this helps,
Alberto

Postnext
Vinayak SapreSubject: Re: Cyclic import in schema
Author: Vinayak Sapre
Date: 25 Mar 2003 05:21 PM
Thanks. I worked the way you suggested.

I am curious that IBM schema quality checker validated it succussfully.
sqc -requireEachDocumentValid c:\webroot\one.xsd c:\webroot\two.xsd

Basically the same file is accessed by two urls Filesystem URL and http URL. Xerces may be treating those as two files. But they have identicle definitions. Does it matter?

Also how do I get error only for one xsd.

Postnext
Alberto MassariSubject: Re: Cyclic import in schema
Author: Alberto Massari
Date: 26 Mar 2003 04:01 AM
At 17.41 25/03/2003 -0500, you wrote:
>From: "Vinayak Sapre"
>
>Thanks. I worked the way you suggested.
>
>I am curious that IBM schema quality checker validated it succussfully.
>sqc -requireEachDocumentValid c:\webroot\one.xsd c:\webroot\two.xsd
>
>Basically the same file is accessed by two urls Filesystem URL and http
>URL. Xerces may be treating those as two files. But they have identicle
>definitions. Does it matter?

It does matter to Xerces. I guess this is related to one of the assumption=
it has: one namespace must be defined in exactly one schema document (for
instance, if you split the two.xsd file into two separate schemas and use
{xsd:import namespace="two" schemaLocation="two1.xsd"/} {xsd:import
namespace="two" schemaLocation="two2.xsd"/} inside one.xsd, only the= first
xsd:import statement is taken into consideration)
[For the record, this assumption is based on the following sentence from
the specs: "multiple 'import'ing of the same schema document will not
constitute a violation of clause 2 of Schema Properties Correct (§3.15.6),=
but applications are allowed, indeed encouraged, to avoid 'import'ing the
same schema document more than once to forestall the necessity of
establishing identity component by component. Given that the schemaLocation=
[attribute] is only a hint, it is open to applications to ignore all but
the first 'import' for a given namespace, regardless of the ·actual value=·
of schemaLocation, but such a strategy risks missing useful information
when new schemaLocations are offered."]
So, if Xerces sees that two.xsd is trying to import the same one.xsd that
has already being loaded (but not yet processed), it will go on processing=
just the definition it needs in that moment; if it sees that you try to
import another URL for the same namespace, it will silently ignore it.


>Also how do I get error only for one xsd.

It depends on the contents of the schemas; definitions are validated only
when requested, so you could have a different behaviour by making a global=
definition local or vice versa.

Alberto

Postnext
Frank YangSubject: Re: Cyclic import in schema
Author: Frank Yang
Date: 08 Mar 2006 06:45 PM
I came cross this subject while looking for explanation of some error messages I got with Stylus Studio 2006 XML Enterprise Version.

So I tried both one.xsd and two.xsd. To my supprise, the version invalidated both xsd files.

If both files are legal, as indicated in the previous replies, does that mean the fix is no longer in the latest release?

Postnext
Minollo I.Subject: Re: Cyclic import in schema
Author: Minollo I.
Date: 08 Mar 2006 08:33 PM
Frank,
it does look like that problem in XercesC is back; we are investigating further and we will let you know.

Thanks,
Minollo

Postnext
Frank YangSubject: Re: Cyclic import in schema
Author: Frank Yang
Date: 09 Mar 2006 11:35 AM
I also noticed that the pattern of error messages:

For a referenced element, it has a pair of errors:
two.xsd:12,38: Type not found in one:ElementOne
two.xsd:12,38: Ref element one:ElementOne not found in the Schema

while for a declared element, it has only one error:
two.xsd:16,52: Type not found in one:OneType

So I am curious if cyclic import is the only cause to this kind of error message.

Postnext
Minollo I.Subject: Re: Cyclic import in schema
Author: Minollo I.
Date: 09 Mar 2006 11:38 AM
Frank,
we have identified the problem; the issue will be addressed in the next Stylus Studio releases, available later this month.

The cyclic inclusion was the problem; please not that the issue is only present when validating the XML Schema itself; if you try validating an XML document based on that schema, things will work as expected.

Thanks for reporting this,
Minollo

Posttop
Frank YangSubject: Re: Cyclic import in schema
Author: Frank Yang
Date: 09 Mar 2006 11:47 AM
Minollo,

Thanks for the confirmation. So for now we can ignore the similar error messages until the defect gets fixed.


Frank

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.