HTML guidelines
Related Topics ...
The Factory incorporates all imported HTML pages into the XML document that defines the model. To ensure that your pages will be imported gracefully, we advise that you follow the World Wide Web Consortium s (W3C) XHTML 1.0 Recommendation when preparing your HTML documents for use with the WebSphere Portlet Factory. While strict adherence to the XHTML Recommendation is not required, it is good practice and facilitates the development of models using your HTML pages.
The following list is meant as a guideline to preparing HTML pages that will be imported into models:
- Know the browsers in which your models will be run.
You will need to write your HTML and any Javascript so that it can be handled by the "lowest common denominator." Some browsers are more forgiving than others.
- Properly nest all tags.
For example, the following tag structure is not good:
<p>
<form>
</p>
</form>
- Avoid very deep (10+) nestings of <table> tags.
- Do not use nested <form> tags
- Do not use HTML or Javascript keywords when naming HTML elements.
For example, do not name <input> tags "submit".
- Close all tags that have closing tags Even if the browser closes them automatically.
For example, most browsers automatically close <tr> tags. Be sure to include a tag s corresponding closing tag when creating your HTML. Examples of tags that do not have closing tags are, <br> and <input>.
The following syntax is not considered to have a closing tag:
<span name="BuilderHere" />. It should be: <span name="BuilderHere"></span>.
- All attribute values must be in double quotation marks (")
For example, the following HTML is good:
<form name="MyForm">
- Always include a <head> tag (with its closing tag, too)
The <head> tag should come before any <frameset> or <body> tags.
All <script> tags should be between the <head> and </head> tags.
- Name all forms and input tags.
- Create "place holders" for additional builders by adding named <span> tags to your HTML pages.
In the Factory s designer, you will be able to "assign" builders to these <span> elements.
- Observe proper tag placement.
For example, this HTML is not good:
</tr>
<div>
</div>
<tr>
It does not make sense to put a <div> tag between two rows in a table.
- Finally, test early and often on all platforms with all intended browsers to find anomalies early in the development cycle.