Groups | Blog | Home
all groups > dotnet xml > september 2004 >

dotnet xml : encoding xml genned by the getxml method of a dataset


marfi95 NO[at]SPAM yahoo.com
9/21/2004 7:59:55 PM
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,
Oleg Tkachenko [MVP]
9/22/2004 2:14:38 PM
[quoted text, click to view]

Whenever XML is being serialized to bytes/created/written.


[quoted text, click to view]

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]
AddThis Social Bookmark Button