At 06:56 AM 5/24/2006 +0000, frofis wrote:
> 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");

Thanks, big, Alberto!
Still, a question - how to define this line in the program.
It is necessary to touch all xsd.

No, only the top-level namespaces (usually a complex schema has a top-level schema and several other defining internal types)

To define the main things.
To allocate targetNamespace.

What do you mean by "main things" and "allocate targetNamespace"?


And how to translate a path of kind
C:\CBuilder\Xml_Pr\EDExamples\Пакеты ЭПД
to a kind
file:///C:/CBuilder/Xml_Pr/EDExamples/??????%20??? (codepage 1251)

You have three choices:
1) directly use the Unicode characters in your source code, e.g. (suppose 0x9012 is the Unicode codepoint for a given Russian letter)

XMLCh str[]={ chLatin_f, chLatin_i, ...., 0x9012, ..., chNull };
parser->setExternalSchemaLocation(str);

or, if your compiler accepts the L"" qualifier,

parser->setExternalSchemaLocation(L"file://C:/\x9012...");

2) use a transcoder for codepage 1251 to do the conversion
3) cross your fingers and hope that the local code page as detected by Xerces is the russian one and just use XMLString::transcode (highly discouraged unless you have a tight control on the machine where your program will run)


And how to translate exception (warnings, errors) on other language (russian)

The infrastructure is in place for locale-specific error messages, but I have never tried it; theoretically you should create a RU folder under <xerces_dir>\src\xercesc\NLS, place a file named XMLErrList_RU.Xml containing the translation of the messages found in <xerces_dir>\src\xercesc\NLS\EN_US\XMLErrList_EN_US.Xml, run the Xlat utility found in <xerces_dir>\tools\NLS\Xlat and move the generated files in the source tree, then rebuild Xerces and specify "ru" in the call to XMLPlatformUtils::Initialize.
But I have never tried such a operation, so it could not be enough...

Alberto

Reply via email to