Mehmet ÇATKIN personal weblog

herşey çooooook .NET

XmlWriter and Schema

clock Haziran 10, 2008 22:07 by author mehmetcatkin
In the ResX exporter for my data driven Resource Provider I use a bit of code that iterates over the database resources and then spits out ResX resources from the data as an option to get your resources into your Web site. The code I've used in this stretch of code uses an XmlWriter to quickly spit out the data. But there are a couple of non-critical problems in that code. Several people have pointed out that the XML generated doesn't exactly match the ResX format that Visual Studio uses (although as far as I can tell there's no problem). The problem is related to an xml:space="preserve" attribute that Visual Studio sticks onto each resource. It does this so leading and trailing spaces are preserved when the values are read. Visual Studio generates:. [More]

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Byte Order Marks and XmlDocument Streaming to HTTP

clock Haziran 7, 2008 20:46 by author mehmetcatkin
Argh. I just got bit again by Byte Order marks that get sent out over HTTP when using ASP.NET. Basically the problem is that .NET's default XmlTextWriter encoding uses UTF-8 and the default Encoding includes generation of a BOM as part of the output. If that output gets sent to the Response output the BOM gets sent along with it which is definitely what you want. In case you don't know what a BOM is - it's the the preamble that gets attached to the beginning of the document to identify its Encoding. There are different preambles for different Encodings. It's meant for files stored on disk so that when a file is opened there's a quick way for an editor to detect the encoding for the file. If you look at a UTF-8 document with a hex editor (or any editor that doesn't apply any encoding) you'd see:. [More]

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Search

Tags

Advertisement

Categories


Calendar

<<  Ocak 2009  >>
PaPaSaÇaPeCuCu
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

Archive

Authors

Blogroll

Recent comments

Copyright

© Copyright 2009 Mehmet ÇATKIN

Sign in