Use accesskey "n" to jump to the internal navigation links at any point. Right now you can
XMetal currently decides by default that any file with a .htm or .html extension is HTML rather than XML. This means that, by default, even if you have set up the img element to be an image using the Tools.Customizations.TreatAs dialogue, you still can't use the icons (and associated dialogue boxes) to insert images or tables in tags-on view in an XHTML document. It also means that in plain text view, where the icons DO work, they insert upper-case element names, which is annoying.
Follow the advice below from the XMetal support person, James Clutterbuck. Note, however, that I only moved .html to the xml list, which allows me to create HTML files, if I want, using the .htm extension.
I have filed a defect report for this xhtml issue and hopefully it should be seen to in an upcoming release or patch.
I have a workaround for you, which should fix the problems you are having.
xhtml files with a .html or .htm extension are treated as html. This produces a number of errors as XMetaL is using two different DTD`s while working with the document. (The html DTD and the proper document DTD).
This can be fixed with the following:
Alter the xmetal3.ini file so that the following appears (this is commented out in the original file):
html_file_extensions = xml_file_extensions = xml;ent;ux;html;htm
Now all .html/.htm files will be treated as XML, solving your problem. If you wish to go a step further, you can also add some JScript macros to alter the Insert Image dialog settings to also ask for the ALT text.
---Optional:
In order to gain access to the Insert Image dialog you now need to access it programmatically when someone inserts an <img> element. Add the following JScript to the On Insert event in Tools.Customizations for the "img" element:
var Dlg = new ActiveXObject("SQExtras.FileDlg");
var chosen = Dlg.DisplayImageFileDlg(true, "Select an Image");
if (chosen) { var FilePath = Dlg.FullPathName;
var FileName = Dlg.FileName;
var FileHeight = Dlg.ImageHeight;
var FileWidth = Dlg.ImageWidth;
Selection.InsertElement("img");
if (Selection.ContainerName == "img") {
Selection.ContainerAttribute("src") = FilePath;
Selection.ContainerAttribute("alt") = FileName;
Selection.ContainerAttribute("height") = FileHeight;
Selection.ContainerAttribute("width") = FileWidth;
}
}By placing the following JScript code inside the event macro "On_Double_Click" (create it if it does not exist), when a person double clicks an <img> element the Insert Image dialog will appear, allowing them to select a different image:
if (Selection.ContainerName == "img")
{
var Dlg = new ActiveXObject("SQExtras.FileDlg");
var chosen = Dlg.DisplayImageFileDlg(true, "Select a New Image");
if (chosen)
{
var FilePath = Dlg.FullPathName;
var FileName = Dlg.FileName;
var FileHeight = Dlg.ImageHeight;
var FileWidth = Dlg.ImageWidth;
Selection.ContainerAttribute("src") = FilePath;
Selection.ContainerAttribute("alt") = FileName;
Selection.ContainerAttribute("height") = FileHeight;
Selection.ContainerAttribute("width") = FileWidth;
}
}When editing an xml file with a particular DTD, say myFile.dtd, XMetal will style the text in the editor according to the rules in myFile.css (which may be in the same directory as the DTD, or one of the Softquad directories). But what if you are dealing with a dtd like XHTML-Transitional, where you are likely to develop many documents with very different styles. How do you make the document you are editing look (more or less) like it will on display?
I created a base .css file by taking XMetal's default HTML style sheet and lower-casing everything (open in Word, select all, then select lower case tranform). I then moved all my styling for the document I was creating into an external style sheet in the same directory as my XHTML file.
Next I added a batch file (I'm in Windows) in the same directory as each different XHMTL file that says:
copy "C:\Program Files\SoftQuad\XMetaL 3\Rules\xhtml1-transitional-base.css"+<add my css file name here> "C:\Program Files\SoftQuad\XMetaL 3\Rules\xhtml1-transitional.css"
This appends my document specific stylesheet to the base stylesheet. When I start editing a file with a different look and feel, I simply double-click on the batch file first, and bob's my uncle!