Question about binary String ?
-
Dear All, I am using MSXML. Here this below function asking binary string. "spText = spDocOutput->createTextNode((_bstr_t)Data);" I have Multibyte/Unicode strings only. How can i write those string in an XML File using this above code ? Kindly Help me. Thanks. Bye.
-
Dear All, I am using MSXML. Here this below function asking binary string. "spText = spDocOutput->createTextNode((_bstr_t)Data);" I have Multibyte/Unicode strings only. How can i write those string in an XML File using this above code ? Kindly Help me. Thanks. Bye.
-
Dear All, I am using MSXML. Here this below function asking binary string. "spText = spDocOutput->createTextNode((_bstr_t)Data);" I have Multibyte/Unicode strings only. How can i write those string in an XML File using this above code ? Kindly Help me. Thanks. Bye.
Sakthiu wrote:
Here this below function asking binary string.
BSTR is NOT "binary string". BSTR is a string format similar to PASCAL strings where the first 4 bytes of the string specify its length and each character in the string is a wide character (that is, uses 2 bytes).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
-
Sakthiu wrote:
Here this below function asking binary string.
BSTR is NOT "binary string". BSTR is a string format similar to PASCAL strings where the first 4 bytes of the string specify its length and each character in the string is a wide character (that is, uses 2 bytes).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
-
Dear All, I am using MSXML. Here this below function asking binary string. "spText = spDocOutput->createTextNode((_bstr_t)Data);" I have Multibyte/Unicode strings only. How can i write those string in an XML File using this above code ? Kindly Help me. Thanks. Bye.
I think you can try the
save
member of parentDOMDocument
object, but it writes the entire XML document, not only your element. If you need just one element, I think you can obtain the XML representation of the node usingxml
property, probably like this:_bstr_t xml = myNode->xml;
Then write this string using file functions. Note that in case of text node, the returned XML string probably will not differ very much from the value you passed to
createTextNode
function. I hope this helps. -
Dear All, I am using MSXML. Here this below function asking binary string. "spText = spDocOutput->createTextNode((_bstr_t)Data);" I have Multibyte/Unicode strings only. How can i write those string in an XML File using this above code ? Kindly Help me. Thanks. Bye.
Don't use casts - especially C-style casts - unless you know exactly what you're doing. If you must cast without fully understanding the ramifications using
static_cast
instead is safer; but still not safe in all situations. If you want to encode binary data in XML you'll have to encode it. For example you could base64 encode it.Steve