Categories
Etc

Read this later…

Hillel sent me this to read. Read it later.

Categories
Etc

XPathExpression.SetContext

After more digging, I found out that it is supported that you have to use the XPathExpression object to do it. You have to compile your XPath expression first using the XPathNavigator, and then you call SetContext on the XPathExpression, passing in your XmlNamespaceManager. Also, something that bit both Mike and I: the prefixes you put in the namespace manager have nothing to do with the prefixes that were originally in the serialized xml. You can make them whatever you want. That way, if you use namespaces without using prefixes, you can still assign a prefix inside the XmlNamespaceManager so that your XPath queries will work. This is devious, devious work.

Categories
Etc

No namespace support in XPathNavigator?

Mike and I were just mucking around trying to make some XPath work with the XPathNavigator. Turns out, we can’t figure out how to make a namespace-aware XPath query with the XPathNavigator. Neither of us see how you would associate a prefix with a namespace to make the query. On an XmlDocument, this is easy using an XmlNamespaceManager, which you pass into Select, but on the XPathNavigator, there’s just no love. I want some love!

Are we on crack? Is there some way to make a namespace-aware query with the XPathNavigator?

Categories
Computers

I18N for Windows

The product I work on currently supports English and Japanese via CodePages. I’ve never really dealt with globalized applications before, so I’m doing quite a bit of research on the matter before I jump in. I’m reading Developing International Applications and finding it to be a fascinating read. I’d always wondered what the System.Text.Encoding object was really all about and now I know. If you read Joel Spolsky, you may have seen his article on globalization, which is a nice intro. DIA is a good bit deeper, weighing in at 529 pages of prose and around 520 pages of appendix. It includes code samples in both Win32 and .NET, which is fantastic, and covers ASP, ASP.NET, and Sql Server in some detail. Additionally, it has the simplest explanation of how to conditionally compile your application for Unicode or MBCS and what it really means. It’s just fantastic.

From what I’m reading, I’m realizing that what we’re doing currently is dead wrong. We send down content encoded using old-style code pages instead of UTF-8 encoded Unicode. I’ll have to work on fixing that. The other thing I found out today is that we store our Japanese content in the ISO-2022-JP code page. I’d like to consolidate the content (it’s currently stored in two separate tables as text, not ntext) into one table with ntext, but there seems to be some limitations with collations and indexes that might be troublesome.

Has anyone else dealt with globalized web sites? Does UTF-8 really work as well as advertised? Some experience from the gallery would really be great.

Categories
Etc

Beanie babies, eBay, and Cheating

What a great way to get back at your cheating ex-spouse. You can just feel the rage through the large text and bad color choices.