Reply to: XML source code formattingJuly 16, 2009 at 5:09 pm
When a CTM file is auto-generated the global pretty printing options in the CTM file are set to disable pretty printing with the presence of an element named
If you are using XMetaL Developer to create your customization then the settings to turn this on are located in a section of the CTM file listed as “Global” near the top of the CTM editor. Use the properties window to enable / disable pretty printing (which removes / adds the “NoPrettyPrinting” setting).
If you are editing this file with another tool (not recommended, but possible to do obviously, as it is plain text) your CTM file should have something like the following in order to have documents pretty printed:
And specifically, you need to remove this as it disables everything else:
Note: When not present (due to a missing customization) both the CTM file and CSS file are auto-generated based on the schema (DTD or XSD). The schema is examined for known element and attribute names (such as
When common names are found that match well-known schema (XHTML and DocBook among others) then the CTM and CSS files may be pretty good, but we really recommend properly designing these files even in this case if you want to give your authors a nice authoring experience. You may use the auto-generated CTM and CSS files as a starting point but they are really not meant to be used directly and in some cases it might even be best to throw them away and design them properly from scratch using XMetaL Developer (in the case where few elements are recognized, as with many US MIL spec DTDs that have virtually no human-readable element names and schema that are not written in English).