This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > March 2004 > Base64 Conversion in MSXML





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Base64 Conversion in MSXML
Martin Shay

2004-03-30, 10:14 pm

I used MSXML typedData to convert a bouble precision data string to a Base64 string. The Base64 string is stroed in the text of an attribute. I print the text of attribute out in the debugger and it worked just fine. However, if I print pXMLDOM->xml to my
output string, a few undesired bytes were put in the middle of the text string of the attribute. The string stored in the attribute should be:
AAAAAAAAAAAtQxzr4jYaPy1DHOviNjo/kst/SL99TT8tQxzr4jZaP3sUrkfhemQ/kst/SL99bT9uowG8BRJ0Pw==

After I print pXMLDOM->xml, it becomes:
AAAAAAAAAAAtQxzr4jYaPy1DHOviNjo/kst/SL99TT8tQxzr4jZaP3sUrkfhemQ/kst/SL99 bT9uowG8BRJ0Pw==

I got " " extra bytes in the middle of the string. I am wondering how I can avoid that from happening.

Thanks a lot.

Martin
Han

2004-03-30, 10:14 pm

I have no idea on your problem. Anyway, is not byte array but line
feed. Saving byte array in text type attribute looks not good idea. I would
set the node type as bin.base64, and retrieve the value via nodeTypedValue
property.

"Martin Shay" <mshay@3eti.com> wrote in message
news:57976771-84B2-41FE-A4C2-6F450DA20050@microsoft.com...
> I used MSXML typedData to convert a bouble precision data string to a

Base64 string. The Base64 string is stroed in the text of an attribute. I
print the text of attribute out in the debugger and it worked just fine.
However, if I print pXMLDOM->xml to my output string, a few undesired bytes
were put in the middle of the text string of the attribute. The string
stored in the attribute should be:
>

AAAAAAAAAAAtQxzr4jYaPy1DHOviNjo/kst/SL99TT8tQxzr4jZaP3sUrkfhemQ/kst/SL99bT9u
owG8BRJ0Pw==
>
> After I print pXMLDOM->xml, it becomes:
>

AAAAAAAAAAAtQxzr4jYaPy1DHOviNjo/kst/SL99TT8tQxzr4jZaP3sUrkfhemQ/kst/SL99
;bT9uowG8BRJ0Pw==
>
> I got " " extra bytes in the middle of the string. I am wondering how

I can avoid that from happening.
>
> Thanks a lot.
>
> Martin



Martin Shay

2004-03-30, 10:14 pm

Han,

Thanks a lot for your hint.

I did find a newline character in the Base64 string converted from the binary Double data array. I used the nodeDataType to do the conversion and did not think that there could be a newline charactor in the middle of Base64 string. Did you have a simular
issue when you convert your data from the binary to Base64?

Martin

----- Han wrote: -----

I have no idea on your problem. Anyway, is not byte array but line
feed. Saving byte array in text type attribute looks not good idea. I would
set the node type as bin.base64, and retrieve the value via nodeTypedValue
property.

"Martin Shay" <mshay@3eti.com> wrote in message
news:57976771-84B2-41FE-A4C2-6F450DA20050@microsoft.com...
> I used MSXML typedData to convert a bouble precision data string to a

Base64 string. The Base64 string is stroed in the text of an attribute. I
print the text of attribute out in the debugger and it worked just fine.
However, if I print pXMLDOM->xml to my output string, a few undesired bytes
were put in the middle of the text string of the attribute. The string
stored in the attribute should be:
>

AAAAAAAAAAAtQxzr4jYaPy1DHOviNjo/kst/SL99TT8tQxzr4jZaP3sUrkfhemQ/kst/SL99bT9u
owG8BRJ0Pw==
>

AAAAAAAAAAAtQxzr4jYaPy1DHOviNjo/kst/SL99TT8tQxzr4jZaP3sUrkfhemQ/kst/SL99
;bT9uowG8BRJ0Pw==[color=darkred]
I can avoid that from happening.[color=darkred]



Han

2004-03-30, 10:15 pm

No I've not experienced that. I *guess* the unexpected thing comes not from
conversion process but somewhere else.

"Martin Shay" <mshay@3eti.com> wrote in message
news:F1EE625F-F5F5-476A-911E-BE82CCD59747@microsoft.com...
> Han,
>
> Thanks a lot for your hint.
>
> I did find a newline character in the Base64 string converted from the

binary Double data array. I used the nodeDataType to do the conversion and
did not think that there could be a newline charactor in the middle of
Base64 string. Did you have a simular issue when you convert your data from
the binary to Base64?
>
> Martin
>
> ----- Han wrote: -----
>
> I have no idea on your problem. Anyway, is not byte array but

line
> feed. Saving byte array in text type attribute looks not good idea. I

would
> set the node type as bin.base64, and retrieve the value via

nodeTypedValue
> property.
>
> "Martin Shay" <mshay@3eti.com> wrote in message
> news:57976771-84B2-41FE-A4C2-6F450DA20050@microsoft.com...
a[color=darkred]
> Base64 string. The Base64 string is stroed in the text of an

attribute. I
> print the text of attribute out in the debugger and it worked just

fine.
> However, if I print pXMLDOM->xml to my output string, a few undesired

bytes
> were put in the middle of the text string of the attribute. The

string
> stored in the attribute should be:
>

AAAAAAAAAAAtQxzr4jYaPy1DHOviNjo/kst/SL99TT8tQxzr4jZaP3sUrkfhemQ/kst/SL99bT9u
> owG8BRJ0Pw==
>

AAAAAAAAAAAtQxzr4jYaPy1DHOviNjo/kst/SL99TT8tQxzr4jZaP3sUrkfhemQ/kst/SL99
> ;bT9uowG8BRJ0Pw==
wondering how[color=darkred]
> I can avoid that from happening.
>
>
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews