473,473 Members | 1,511 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how do I Serialize data containing & in it

My data may contain the characters < ,&, and > The system I'm sending
them to wants them to be changed to < & and > respectivily.

So I had gone into the data and was changing them over in the code. However
when they hit the serializer I end up with

&amp;#60; &amp;#38; and &amp;#62;

How can I prevent the serializer from changing this incorrectly?

This is done on the compact framework incase that matters?
Apr 25 '06 #1
4 1311
Hello ,

Thank you for posting. Currently we are finding proper resource to assist
you on this issue and will update you as soon as possible.

Thanks,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 26 '06 #2
jamie wrote:
My data may contain the characters < ,&, and > The system I'm sending
them to wants them to be changed to < & and > respectivily.
It shouldn't need to for > because that's not a markup character,
it's just data when it occurs in normal text; but maybe the target
system doesn't know that.
So I had gone into the data and was changing them over in the code. However
when they hit the serializer I end up with

&amp;#60; &amp;#38; and &amp;#62;

How can I prevent the serializer from changing this incorrectly?


My guess is you shouldn't have changed them at all, because now the
& is being output as &amp;

Before, what were they outputting as?

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Apr 26 '06 #3
I've spoken with them and it turns out their documentation is out of date.
The < & and &#62 was put in place for people manually generating
XML files and not using something like the serializer. They now accept the
standard translation so I can undo my changes.
"Peter Flynn" <pe********@m.silmaril.ie> wrote in message
news:4b*************@individual.net...
jamie wrote:
My data may contain the characters < ,&, and > The system I'm sending
them to wants them to be changed to < & and > respectivily.


It shouldn't need to for > because that's not a markup character,
it's just data when it occurs in normal text; but maybe the target
system doesn't know that.
So I had gone into the data and was changing them over in the code.
However when they hit the serializer I end up with

&amp;#60; &amp;#38; and &amp;#62;

How can I prevent the serializer from changing this incorrectly?


My guess is you shouldn't have changed them at all, because now the
& is being output as &amp;

Before, what were they outputting as?

///Peter
--
XML FAQ: http://xml.silmaril.ie/

Apr 26 '06 #4
Hi Jamie,

As far as I know the escaping is done automatically by the serializer.
Because these characters have special meaning, we have to change them to
other codes. Please don't change them manually, or the deserialization will
fail.

Kevin Yu
Microsoft Online Community Support

================================================== ==========================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==========================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 27 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James Sleeman | last post by:
Hi all, i just spent an hour rifling through code to find the cause of a problem only to find it's an oddity with serialization and recursive objects, so figured I'd post for the next person who...
1
by: Michael | last post by:
Hi I anyone have a clue or can solve my problem I would be glad :-) Regards Michael I have a problem with creating an XML-document where the returning data from the webservice, have been...
5
by: Brian Reed | last post by:
I have a class that I want to serialize to an XML string. I want the XML to serialize to utf-8 encoding. When I serialize to an XML file, the data looks great. When I try to serialize to a String...
2
by: IanT | last post by:
Hi I need help with my approach to validating de-serialized XML received via webservice. Hopefully someone can point me to sources detailing best practice for the following. I agreed a...
7
by: Lars-Erik Aabech | last post by:
Hi! I've got problems with serializing my collections of business objects. The objects themselves serialize fine, but the collections fail. I've got the following structure: Base collection...
0
by: Ken Durden | last post by:
I'm getting the following exception coming out of a block of unmanaged C++ code. Thread executed for 1.03 sec and died with the following exception: External component has thrown an exception. ...
2
by: Dave | last post by:
I have an application running on a 3 server webfarm running Windows 2003 with SQLServer Session state. After running for several hours, I started getting the following error. When I access each...
4
by: =?Utf-8?B?Qnlyb24=?= | last post by:
When I try to serialize an instance of the LocationCell below (note Building field) I get an error in the reflection attempt. If I remove the _Building field it serializes fine. I tried renaming...
2
by: teddysnips | last post by:
Windows Application Visual Studio 2005 I am new to C# and have done very little XML or serialization. My client wishes me to store configuration data in an XML file. It will look something...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.