Hi Scott, sfwilson <[EMAIL PROTECTED]> wrote on 08/02/2006 08:36:25 AM:
> Hi, > > Here is a problem I am having. I am using a binary build of xerces 2.8.0. > and using sax.Counter to validate an xml instance. I am using the following > command on the command line: > > java sax.Counter -v -s -f -n -np ... > > The xml instance has a top level element: > > <aixm:Update > xmlns="http://www.aixm.aero" > xmlns:eur="http://www.aixm.aero/eur" > xmlns:aixm="http://www.aixm.aero" > xmlns:gml="http://www.opengis.net/gml" > xmlns:xlink="http://www.w3.org/1999/xlink" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.aixm.aero/eur AIXM-ADR.xsd" > gml:id="MSG0000002"> > > AIXM-ADR.xsd does not contain the Update element. However, it imports > another schema: > > <import namespace="http://www.aixm.aero" > schemaLocation="AIXM-GML-BasicMessageTypes.xsd"/> > > The Update element is in the secondary schema. > > When I validate the instance, XMLSpy reports the instance document as valid. > However, sax.Counter reports: > > [Error]... cvc-elt.1: Cannot find the declaration of element aixm:Update ... > > > I'll continue to investigate this myself. However, is this a known > limitation with Xerces? Xerces lazily assembles the Schema as it validates the document. It defers reading/processing a schema document for a given target namespace until triggered by a name {element, attribute or type} from that namespace. The namespace of the root element of your document differs from the target namespace of AIXM-ADR.xsd so this seemingly unrelated schema document is never read and no element declaration is found for "Update". If you change the schemaLocation attribute to xsi:schemaLocation="http://www.aixm.aero AIXM-GML-BasicMessageTypes.xsd http://www.aixm.aero/eur AIXM-ADR.xsd" it should work. > Any help would be appreciated. > > Regards, > > Scott > -- > View this message in context: http://www.nabble.com/import-of-root- > element-from-secondary-schema-tf2039564.html#a5612891 > Sent from the Xerces - J - Users forum at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
