Message:

   The following issue has been closed.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESC-748

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESC-748
    Summary: Validating against schemas importing other schemas
       Type: Bug

     Status: Closed
 Resolution: INVALID

    Project: Xerces-C++
 Components: 
             Validating Parser (Schema) (Xerces 1.5 or up only)
   Versions:
             2.5.0

   Assignee: 
   Reporter: Frank Pilhofer

    Created: Thu, 4 Mar 2004 6:53 PM
    Updated: Tue, 19 Oct 2004 8:41 AM
Environment: Operating System: All
Platform: All

Description:
I am using Xerces-C 2.5.0 on Windows (VC++ 6), but the problem should be
independent of the platform.

I have a schema "A" that imports types from another schema "B", so at
the top of A.xsd, I declare the B namespace, and import it, as

<xsd:schema xmlns:B="http://foo/B"; [...]>
  <xsd:import namespace="http://foo/B";>
  [...]
</xsd:schema>

Now, when I parse a document with validation enabled, Xerces reports an
error (via my error handler) saying "Schema Representation Constraint:
Namespace 'http://foo/B' is referenced without <import> declaration.

The error disappears if I change the above import statement, in the "A"
schema, to include a schemaLocation:
  <xsd:import namespace="http://foo/B"; schemaLocation="B.xsd">

I do not want to hardcode locations in a schema. Instead, I tried to
supply the schema location in the XML document (as xsi:schemaLocation),
but that didn't help. I also unsuccessfully tried to provide the schema
location via the "XercesSchemaExternalSchemaLocation" property.

A full test case is attached: test.cpp tries to parse the "test.xml"
document, which uses the schema "A.xsd", which imports "B.xsd" and
uses one of its attributes. When run, the test program should print,
from its DOMErrorHandler, the message

Error: <path>/A.xsd: Schema Representation Constraint: Namespace
'http://foo/B' is referenced without <import> declaration

I would expect the test program to succeed with no errors being
reported.

Thank you,
Frank


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to