Feb 02
When using XSLT’s format-number() function to format a decimal, consider using a zero in the least significant place of the decimal part of your format string. This will allow a number with a 0 integer part to display correctly.
For example:
| Number |
format-number using #,### |
format-number using #,##0 |
| 12345 |
12,345 |
12,345 |
| 5 |
5 |
5 |
| 0 |
No output! |
0 |
This also applies to decimals:
| Number |
format-number using #.00 |
format-number using 0.00 |
| 5 |
5.00 |
5.00 |
| 0 |
.00 (Note no leading 0) |
0.00 |
| 0.1234 |
.12 (Note no leading 0) |
0.12 |
Jan 11
While I had originally planned on stretching out my Implementing IXmlWriter series of posts into at least three or four more posts, I’ve decided to end it here. Here is a list of the posts in the series:
Off the top of my head, here are a few things left to implement:
- Processing instructions
- Doc type declarations
- CDATA declarations
- Entity references
- Character entities
- Character encodings (e.g. UTF-8, UTF-16, etc.)
- Robust error handling, such as throwing an exception if WriteAttribute() is called with an illegal character
Update: 2007-07-11 10:58 PM: Microsoft’s XmlLite provides all this and more for Windows developers.
Jan 10
Today I will add support for writing the generated XML to a C++ stream to last time’s IXmlWriter.
Read the rest of this entry »
Dec 15
As the private members of IXmlWriter are getting too numerous and too likely to change by my judgment, today I will put last time’s IXmlWriter behind a compilation firewall (pimpl).
Read the rest of this entry »
Nov 17
Wow, I can’t believe that it’s been over a month already since my last IXmlWriter post. I guess my vacation ruined my exercise plan and my blogging habits. It’s well past time to get back into both.
Rather than introduce a new test case, I’m going to spend today “cleaning up” the previous version of IXmlWriter.
Read the rest of this entry »
Recent Comments