At 02:53 PM 5/23/2006 +0000, frofis wrote:
Versions: 2.4.0 Environment: win2000, CBuilder 6
http://www.cbr.ru/analytics/Formats/UFEBS_EDExamples.zip - ED101_1
http://www.cbr.ru/analytics/Formats/UFEBS_XMLSchemas_v1_1_2.zip - *.xsd
XercesDOMParser *parser = new XercesDOMParser;
parser->setValidationScheme(true);
parser->setDoNamespaces(true);
parser->setDoSchema(true);
parser->setDoValidation(true);
parser->setExternalSchemaLocation("file:///C:/CBuilder/Xml_Pr/*.xsd");
ErrorRep *errRep = new ErrorRep();
parser->setErrorHandler(errRep);
try {parser->parse("file:///C:/CBuilder/Xml_Pr/ED101_1.xml");}
catch (...) {ShowMessage("...");}
delete errRep;
delete parser;
Fatal error line 2 column 209 The schemaLocation attribute does not contain
pair of values
frofis,
you are misunderstanding how the externalSchemaLocation attribute
works: as the specs clearly says (see
http://www.w3.org/TR/xmlschema-0/#schemaLocation) it must contain a
series of string pairs, where the first one is the namespace URI and
the second the location of the schema file.
In your case, something like
parser->setExternalSchemaLocation("http://www.w3.org/2003/05/soap-envelope
file:///C:/CBuilder/Xml_Pr/soap-envelope.xsd
urn:cbr-ru:msg:props:v1.1
file:///C:/CBuilder/Xml_Pr/cbr_msg_props_v1.1.0.xsd
urn:cbr-ru:ed:v1.1 file:///C:/CBuilder/Xml_Pr/cbr_ed_v1.1.2.xsd");
Hope this helps,
Alberto