Hi,
In one of the Tru64 system running japanese locale, while parsing the
xml document using DOMBuilder, it is creating an empty DOM Document.
Here is the sample of the code I have written. I tried to print the
document after the parsing using DOMWriter. It is printing empty
document in the japanse system, where as it is printing the correct
document on a english locale system. If I print the string
newformattedstr, before parsing it is printing properly. The xml string
contains only english characters.
DOMBuilder *parser_p = NULL;
{
// Wraps formattedMsg_r to create input structure for the parser
MemBufInputSource memBuf_p(
(const XMLByte*)newformattedstr.data()
, newformattedstr.length()
, "info"
, false
);
Wrapper4InputSource msg(&memBuf_p);
// Sets up the parser
static const XMLCh gLS[] = { chLatin_L, chLatin_S, chNull };
DOMImplementation *impl_p =
DOMImplementationRegistry::getDOMImplementation(gLS);
assert(impl_p);
parser_p = ((DOMImplementationLS*)impl_p)->createDOMBuilder(
DOMImplementationLS::MODE_SYNCHRONOUS,
0);
assert(parser_p);
parser_p->setFeature(XMLUni::fgDOMNamespaces, false);
parser_p->setFeature(XMLUni::fgXercesSchema, false);
parser_p->setFeature(XMLUni::fgXercesSchemaFullChecking, false);
parser_p->setFeature(XMLUni::fgDOMValidateIfSchema, true);
parser_p->setFeature(XMLUni::fgDOMDatatypeNormalization, true);
// Pointer to the temporary xml strucutre
DOMDocument* tempDoc_p = NULL;
try
{
parser_p->resetDocumentPool();
tempDoc_p = parser_p->parse(msg);
}
catch (const XMLException& e)
{
......
}
catch (...)
{
...............
}
// Root node of the temporal document.
DOMNode* tempRootNode_p =
(DOMNode*)tempDoc_p->getDocumentElement();
assert(tempRootNode_p);
XMLCh *tempDoc = theSerializer_p->writeToString(*tempDoc_p);
assert(tempDoc);
char *output_tempDoc = XMLString::transcode(tempDoc);
outfile<<output_tempDoc<<endl;
parser_p->release();
}
Any information on this will be of great help.
Best Regards
Prakash
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]