Hi and thx

here is the code for the serialisation :

   XMLCh tempStr[100];
   XMLString::transcode("LS", tempStr, 99);
   DOMImplementation *impl =
DOMImplementationRegistry::getDOMImplementation(tempStr);
   DOMLSSerializer* theSerializer =
((DOMImplementationLS*)impl)->createLSSerializer();

   DOMLSOutput* theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
   theOutput->setEncoding((XMLCh *)"ISO-8859-1");

   try
   {
      theSerializer->writeToURI(node, XMLString::transcode(path));
   }


I'll try with the XMLString::transcode to check...



Alberto Massari wrote:
> 
> First of all, you cannot simply cast a char* to be a XMLCh*, but you 
> need to convert it using XMLString::transcode (and releasing the string 
> after that). Then, how are you serializing the document?
> 
> Alberto
> 
> radada wrote:
>> Hi Alberto and thx again for answering : )
>>
>> I tried to do it using this code : 
>>
>> DOMLSOutput* theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
>> theOutput->setEncoding((XMLCh *)"ISO-8859-1");
>>
>> but the XML files declaration stil was <?xml version="1.0"
>> encoding="UTF-8"
>> standalone="no" ?>. How's that?
>> Thx again for your help.
>>
>>
>>
>>
>> Alberto Massari wrote:
>>   
>>> In the DOML3 specifications, the encoding is set in the DOMLSOutput 
>>> object that is passed to DOMLSSerializer::write.
>>>
>>> Alberto
>>>
>>> radada wrote:
>>>     
>>>> Hi there again  : ))
>>>>
>>>> I've been searching on how to set the XML encoding of the XML
>>>> declaration
>>>> output file in xerces 3.0 (C++)
>>>> In the previous versions, I had to call the setEncoding method of the
>>>> DOMDocument, but I can't find it now.
>>>> As a result, the XML files have the "UTF-8" encoding in the declaration
>>>> while I need them to be in "ISO-8859-1".
>>>>
>>>> Thx a lot guys.
>>>>   
>>>>       
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Specifying-XML-Encoding-tp23195708p23197345.html
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to