I need to serialize my signed xml document into string. And the problem is: when I serialize xml document DOMWriteImpl reorder (sorts in alphabetic order) attributes in each node , change < and &, :(..
My samlpe code (based on apache.org) looks like:
------------------------------begin---------------------------------
XMLCh tempStr[100];
XMLString::transcode("LS", tempStr, 99);
DOMImplementation *impl =DOMImplementationRegistry::getDOMImplementation(tempStr);
DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
DOMPrintFilter *myFilter=0; // set user specified end of line sequence and output encoding theSerializer->setNewLine(gMyEOLSequence); theSerializer->setEncoding(gOutputEncoding);
XMLFormatTarget *myFormTarget; myFormTarget = new MemBufFormatTarget(50000);
theSerializer->writeNode(myFormTarget, *doc);
XMLByte *buf; unsigned int uiBufLen = ((MemBufFormatTarget*)myFormTarget)->getLen();
const XMLByte* pcBuf; pcBuf = ((MemBufFormatTarget*)myFormTarget)->getRawBuffer();
-------------------------------end---------------------------------
And the question is: how to serialize xml document in such way, that it isn't sorted, characters like '<', '&' are not changed into > ?
Why is it so important? because I have created digital signature over this document before serialization and after DOMWriterImpl 'reorder-work' signature is broken.
looking for your help, best regards, andrew
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
