General XMetaL Discussion
vlambert July 16, 2009 at 1:10 pm
XML source code formattingJuly 16, 2009 at 1:10 pmParticipants 1Replies 2Last Activity 13 years, 2 months ago
Me and my team are currently developing the documentation for a product and we are using XMetal to do so. Up to now, we are quite satisfied, except for one detail: the xml source code has no formatting.
According to the documentation, the .ctm file is supposed to take care of that. We are using the ctm file that was generated automatically, its content is what we need (it seems to be generated from the css file for the tags-on view and the normal view). The only problem is that it is not applied to the xml document. Whatever we change in that file, it is not reflected in the source code. How do we make it work ?
Thank you for your help.
Matrox ImagingDerek Read July 16, 2009 at 5:09 pm
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
, , ,
, etc) and a best guess is made based on rudimentary logic that also examines the relationship between elements (which children are allowed where).
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).
- You must be logged in to reply to this topic.