|
From: Peter C. C. <pc...@ec...> - 2003-05-07 13:27:25
|
In the past I've experimented with XMLSpy for schema editing. However, it seems to take away some of my control regarding the layout of the schema file itself. This results in a schema file that is less readible and less easily printed as a plain text document than it should be. I teach courses in programming and I tell my students to restrain themselves when formatting source code and to limit the lengths of lines to 80 characters maximum. In todays world of large, graphical displays such a limitation seems crazy. But when I tell my students to print their programs... with sufficient margins to bind the papers into a report... the need to keep line lengths down becomes clear. It can be argued, of course, that printing programs is old fashion but there are other contexts where text documents need to be displayed and where there are limited space resources. For example, simple terminals are often highly limited and even text mode terminal sessions can suffer from mundane limitations. The bottom line is that when I need to edit plain text I tend to find myself, time and again, reaching for a plain text editor. While XMLSpy is pretty cool and I have enjoyed using it. I seem to gravitate to Emacs when I write anything serious. Our current schema document does not look good as plain text. It contains long lines that will not print well (without invoking a tiny font) and it lacks blank lines to set off the various sections of the document, making it hard to visually decode the document's structure. I'm attaching to this message a version of the schema that is reformatted in a manner that is more approachable to plain text editing. A few notes: 1. This reformatting introduces runs of whitespace in the <xs:documentation> elements. In many cases such whitespace existed already but in some cases it was added where it didn't exist. I don't think this is a problem because we are mostly using XHTML <p> elements for documentation and the whitespace is insignificant in XHTML. 2. The CDATA section is not indented, of course. 3. The long patterns in the restricted simple types are not wrapped, of course. 4. The indentation depth of the original document was 4 (somewhat inconsistently applied). I usually like to use 2 since a deeper depth quickly exhausts the limited horizontal space. If I reformatted the document to use 2, some of the documentation sections would probably "fit" better. If I were working on this project alone I would definitely go with a reformatting like this. However, maintaining such a format might be difficult for people using editors that are not text editors. For example it seems that XMLSpy removes the blank lines... an aspect of that editor that I find highly annoying. Also XMLSpy won't automatically break a line in an element... meaning that one has to manually manage all the line breaks. That's a major drag. (In contrast Emacs can wrap them for me automatically without disrupting the rest of the document). What are people's views on this matter? Fundamentally the way the raw document should look will depend on what people are using for editors. It seems like we need to make a statement about that since the defaults of one editor are likely to undo the changes made by another. Programmers have style conventions to address this sort of issue. Are there similar practices in the XML community? Peter |