Hi,

        To confirm, your first schema has no target namespace?


(Sorry if this appears as a duplicate)

Gareth

Milan Tomic wrote:
Have anyone noticed my post? :>
    -----Original Message-----
    *From:* Milan Tomic [mailto:[EMAIL PROTECTED]
    *Sent:* Wednesday, August 24, 2005 10:10 AM
    *To:* [email protected]
    *Subject:* XML Schema advanced question

    Hi,

    I have three schemas:

    1. First that imports second,
    2. Second that imports third,
    3. Third that imports second.

    Schemas were imported in this way:

    <xs:import namespace="someURL"
    schemaLocation="http://www.someURL.com/MySchema.xsd"/>

    I'm loading first schema from my resources (VC6 compiler) into
    Xerces 2.5 parser in this way:

    XercesDOMParser * parser = new XercesDOMParser;
    parser->setDoNamespaces(true);
    parser->setCreateEntityReferenceNodes(true);
    MemBufInputSource * is = new MemBufInputSource(schema, schemaLen,
    "MySchema");
    parser->loadGrammar(*is, Grammar::SchemaGrammarType, true);
    parser->setDoSchema(true);
    parser->setValidationSchemaFullChecking(true);
    parser->setValidationScheme(XercesDOMParser::Val_Always);
    parser->useCachedGrammarInParse(true);
    parser->parse("C:\\My.xml");

    The problem is that I allways got an error saying that none element
    (root element, root element's attributes...) in my XML file was
    defined. :(

    If I use setExternalNoNamespaceSchemaLocation("C:\\MySchema.xsd")
    instead of loadGrammar() it works fine (doesn't report any errors).

    What should I do?


--
Gareth Reakes, Managing Director           Embrace Mobile
+44-1865-811197              http://www.embracemobile.com

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

Reply via email to