You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2004/03/04 19:53:43 UTC

DO NOT REPLY [Bug 27450] New: - Validating against schemas importing other schemas

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27450>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27450

Validating against schemas importing other schemas

           Summary: Validating against schemas importing other schemas
           Product: Xerces-C++
           Version: 2.5.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Validating Parser (Schema) (Xerces 1.5 or up only)
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: fp@mc.com
                CC: fp@mc.com


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

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org