XML Editors

I have been getting a ton of use recently from a new piece of code that one of our architects,Chris Lovett, wrote. If you are into System.Xml, you may have seen the XmlNodeWriter, SgmlReader, or XmlCsvReader that he built. I hope that his latest tool will make it onto gotdotnet soon as well.


I’m also using InfoPath a lot. I was tempted to jump in with comments a month or two ago when everyone was raving about InfoPath, but I thought I would hold out and get some more miles before making public judgment. I was on the team a long time ago (two name-changes ago), and went through my initial infatuation with the product at that time. So I figured I should use it day-to-day in the same version that will be shipping to customers (it has changed a lot) so I could give a realistic report. My relationship with InfoPath has matured, and I am happy to say that it looks like it is going to last. I am finding that I use it to keep track of all sorts of things; it makes it a breeze to whip up a form for keeping track of partly-structured information. For example, each item on my to-do list can have a timestamped list of notes in XHTML. And I actually use it. Here are the main tips I can think of right now:



  • If you don’t want to come up with an XSD schema first (I never do), just drag-drop controls on the form, and hover over the control to change the name of the element or attribute that InfoPath picks for you.

  • Alternately, you can use notepad to whip up a sample XML file with your general shape,then let InfoPath infer an XSD and form layout from that sample XML. I’ve used this a few times; it grows on you. It’s like “schema design by example”. That feature alone makes it a product worth having.

  • You can use the “infer from sample” technique just described if you want infopath to create a schema that doesn’t use namespaces.

  • .xsn file is just a .cab file. Rename it to .cab and double-click. Now you have some power.

  • The InfoPath form designer generates portable XSLT that you can use anywhere. I tried it, it works.

  • Form designer doesn’t let you draw a recursively-nested form. But you can edit the XSLT manually to recursively apply templates, and InfoPath honors the recursion when editing XML using that form.

  • If you use InfoPath form designer to create/edit your XSD, it changes the namespace URI whenever you add or change fields in the data source. Each instance of your XML document will be bound to the namespace that was used when the instance was first saved. If you want an XML instanceto use the new, updated form, you can change the namespace URI used in the document. Of course, you should only do that if you know that the existing doc is still valid to the new schema. Another option is to hard-code the namespace URI in the solution, by using an external XSD schema; but then you are on your own for versioning.

~


I like words. I need to make a list of “cool words” that I can use to keep track of words that make me happy. I’ve noticed that the quality of language in general use in literature and rhetorichas deteriorated dramatically over the past decades. I would suppose that it’s gotten steadily worse for the past hundred years or so, but the declineis detectable even since I left high school. As an example, today I heard a news anchor for one of the major networks refer to Martha Stewart’s indictment as “the mother of all perp-walks”. I’ll admit that “perp-walk” is effective at communicating a whole range of desired connotations, but where is the dignity? And how hackneyed is “mother of all”? I really don’t think the newsperson was effectively communicating. She was trying to convey the sense that “cameramen and news crews are eagerly waiting to catch the moment on film”, and perhaps that“this indictment is prompting a bigger media feeding frenzy than Gotti”. There is a slight chance that she used “mother of all” in a cutesy matronly sense, but in my opinion such punny and double-entendreuse of words by newspeople is even less excusable (albeit common)than would be the use of a hackneyed phrase. That sort of thing wasfunny in sixth grade, not in my newspaper.

WordPress database error: [Can't open file: 'wp_comments.MYI'. (errno: 145)]
SELECT * FROM wp_comments WHERE comment_post_ID = '387' AND comment_approved = '1' ORDER BY comment_date

Leave a Reply