No, if the serialized attribute value has newlines/tab, they are
converted upon loading into spaces. If you want to really store such
characters in an attribute, they have to be encoded into entities.
Alberto
mini thomas wrote:
Hi,
I am using xerces 3.0.1 and doing the following
1) Parse a string
2)Set an attribute "newattr" on the root node. The attribute value is
char *temp = "\n Hello \t\t testing"
3) converting the parsed data back to xml
static const XMLCh gLS[] = { chLatin_L, chLatin_S, chNull };
DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(gLS);
DOMLSSerializer* myWriter = (impl)->createLSSerializer();
DOMConfiguration* dc = myWriter->getDomConfig();
dc->setParameter( XMLUni::fgDOMWRTDiscardDefaultContent,true);
// serialize the DOMNode to a UTF-16 string
XMLCh* theXMLString_Unicode = myWriter->writeToString(toWrite.GetDOMNodePtr());
4) Convert theXMLString_Unicode to char* and print using cout.
I got the attribute printed this way.
newattr="
 Hello 		 testing"
Is there any way to get the attribute printed as newattr="
Hello testing"
Thanks,
Mini