IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: xmlhack
About
User Name: xmlhack
Forum Rank: Newbie
Real Name:
Location US
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Thursday, April 19, 2018
Last Visit: Wednesday, April 25, 2018 12:56:18 PM
Number of Posts: 2
[0.01% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: hexBinary
Posted: Tuesday, April 24, 2018 4:08:22 PM
I got this to work. Probably not 100% syntactically correct, but gives me what I want.



std::vector<unsigned char> data;
unsigned char c, d, c_hex, d_hex;

for ( unsigned int i = 0; i < uuid.length(); i++)
{
c = (unsigned char) uuid[i];
d = (unsigned char) uuid[i+1];

c_hex = (int)strtol((const char *)&c, NULL, 16);
d_hex = (int)strtol((const char *)&d, NULL, 16);

c_hex <<= 4;
c_hex |= d_hex;

data.push_back(c_hex);
i++;
}

return data;
Topic: hexBinary
Posted: Thursday, April 19, 2018 6:23:45 PM
I have mapforce 2016 and MS VS 2010.

How do I convert a UUID of type string to hexBinary?

For example, I want to convert the string from:

"BB08000000000000000000000000000000"

to

BB08000000000000000000000000000000

I can get it to the hex representation (E.g., 42424F.......) using std::vector<unsigned char>



Use of the Altova User Forum(s) is governed by the Altova Terms of Use.