OKi doki, I'll try that tomorrow at work.
Thanks a lot for your precious help Alberto : )
Alberto Massari wrote:
>
> writeToURI is simply a shorthand for creating a DOMLSOutput, calling
> setSystemId on it, and invoking write().
> Just add the setSystemId call to your code, and change writeToURI into
> write().
>
> Alberto
>
>
> radada wrote:
>> Lol I just saw that I wans't using the DOMLSOutput because I used the
>> writeToUri method...
>> Back to square one : how can I do it? Using write method and then get the
>> string back with another method?
>> Thx...
>>
>>
>> radada wrote:
>>
>>> 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]
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> 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-tp23195708p23200551.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]