QDomElement to QByteArray ?
I am parsing a QByteArray. Inside the QByteArray there is text in XML form.
At some point in this XML, there is an Element that I want to consider and use it as QByteArray. The other Elements are used as text, therefore I can conver the element to text by doing something like: e.text();
How can I use the element and keep it as QByteArray ?
Re: QDomElement to QByteArray ?
Either use a CDATA section or encode your byte array in some way, so that it uses only ASCII characters (the easiest solution is to use BASE64, because Qt would do the conversion for you, but you also convert each byte to a hex value).
Re: QDomElement to QByteArray ?
Inside the XML element there is an image, so I do not want to convert it to Ascii.
I want to treat the element as QByteArray.
Re: QDomElement to QByteArray ?
XML is text, not binary data. Either convert that QByteArray to text or try CDATA section.