HTML Best Practices
There are a number of things to consider for HTML in Xopus. Xopus needs valid XHTML in its output.
- Special characters need to be saved as they are, not as entities.
- Xopus needs valid XHTML output.
- Don't use
<legend>or<fieldset>
Entities and special characters
Entities, special characters and such, are best added as they are in UTF-8 encoding. Of course it impedes the searchability of the documents if you save them as HTML entities. For transport however it isn't an issue to save special characters as entities.
Valid XHTML
Xopus needs to have valid XHTML. This means that you cannot put a <table>, <div> or a list element inside a paragraph. The problem with this is that a these elements block elements, and a paragraph has an optional closing tag. Therefore when rendering a <div> in a <>p (<p><div></div></p>) Internet Explorer will assume a </p> closing tag before drawing the <div> (e.g.: <p></p><div></div>) because it cannot have a block level element in the paragraph. This means that your paragraph isn't <div> is rendered after the paragraph. The HTML will look like this:
<p></p> <div>your text from the xml</div> </p>
If you want to see if your HTML is valid, you can load your HTML in Xopus and pressCtrl+Alt+V. Xopus will then validate the HTML. This validation is less strict than the W3C specifications for XHTML.
A side-note to this is that Xopus 3 does not react well to the use of any Standard Compliance mode (DOCTYPE definitions). Working in Quirks mode gives Xopus 3 a little leeway with Internet Explorer and will often solve certain display problems. In Xopus 4 documents rendered in Standard Compliance mode will work as expected.
Don't use <legend> or <fieldset>
Well, that says it all really. Don't use those elements in your XSL output for Xopus HTML.
- Documentation
- › Best Practices
- › HTML Best Practices