471,594 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 software developers and data experts.

encoding xml genned by the getxml method of a dataset

I have a basic question about xml encoding and predefined characters
in xml. I know that characters such as "<" get encoded to &lt; My
question is when does this actually happen? I'm using the getxml()
method of a dataset to build my xml, but before I send it to the
server, I prepend an encoding scheme of UTF-8. Does just adding this
declaration correctly encode the characters on the way to the server
or does it already expect them to be in in the dataset prior to
calling getxml ?

Thanks,
Mark
Nov 12 '05 #1
1 3419
Mark wrote:
I have a basic question about xml encoding and predefined characters
in xml. I know that characters such as "<" get encoded to &lt; My
question is when does this actually happen?
Whenever XML is being serialized to bytes/created/written.

I'm using the getxml()
method of a dataset to build my xml, but before I send it to the
server, I prepend an encoding scheme of UTF-8.


Character encoding has nothing to do with escaping of < and &
characters, it's completely different things. In any XML document, in
any character encoding < and & must be escaped as &lt; and &amp;.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Chris | last post: by
2 posts views Thread by Rajesh AVRS | last post: by
1 post views Thread by Kashyap | last post: by
3 posts views Thread by Mark | last post: by
2 posts views Thread by Ganesh Muthuvelu | last post: by
1 post views Thread by lucky | last post: by
3 posts views Thread by Greg Collins [Microsoft MVP] | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

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.