xoxo-faq

From Microformats Wiki
Revision as of 06:24, 9 October 2005 by Tantek (talk | contribs) (restore post backup restoration changes)
Jump to navigation Jump to search

XOXO FAQ

This page documents questions and answers regarding the xoxo (Extensible Open XHTML Outlines) format. Abusive language and spam comments/links will be deleted.

Q: why is compact/expanded expressed via a new attribute and not by a style class? Wouldn't it be more compatible to simply use a style class?

A: The 'compact' attribute is not a new attribute. It is defined in XHTML Modularization, and has been in HTML (4, 3.2, 2) since HTML Plus. Whenever possible it is better to reuse an existing HTML attribute for semantics, instead of a style class. The essay A Touch of Class discusses such semantic nuances in more detail.

Q: Follow-up: wouldn't a style class applied to the sub-outline's parent <li> element allow control over the rendering of the outline and its subject (e.g. adding an expand/collapse widget as a bullet-point)?

A:See previous A: it is better to reuse an existing HTML attribute for semantics, rather than a style class. A style rule can be written to utilize the "compact" attribute just as easily as the "class" attribute, and then allow control over rendering of the outline and its subject.

Q: Follow-up: Is 'compact' supposed to remove borders and spacing around a list? A: No. Please RTFM. HTML 4.01 on the 'compact' attribute: "When set, this boolean attribute gives a hint to visual user agents to render the list in a more compact way." And rendering the list in a more compact way (in particular, fully compacted) is exactly what xoxo specifies for the 'compact' attribute.

Q: Why don't MarkP's examples use <ol class="xoxo"> ?

A: The use of class="xoxo" is optional for XOXO authors and user agents.

Q: MarkP uses <p> in some of his examples. Is that allowed? If yes, shouldn't <p> then be added to the description of XOXO's "document type" (see above)?

A: Yes, additional elements and/or attributes are allowed per XHTML Modularization, and no, all such possible additions (e.g. <p>) don't need to be added to the XOXO document type since XOXO user agents may simply treat them according to the XHTML Modularization user agent conformance requirements (4-6):

  1. ...
  2. ...
  3. ...
  4. If a user agent encounters an element it does not recognize, it must continue to process the children of that element. If the content is text, the text must be presented to the user.
  5.	If a user agent encounters an attribute it does not recognize, it must ignore the entire attribute specification (i.e., the attribute and its value).
  6.	If a user agent encounters an attribute value it doesn't recognize, it must use the default attribute value.

Q: Why isn't the XForms "appearance" attribute used instead of "compact"?

A: Why should the XForms "appearance" attribute be used? There is no need for it, nor is there any need for a second namespace to make simple things more complicated than they need to be.

Q: Can an XOXO item have a multi-valued property, or a property with multiple values?

A: Yes. Here is how you would do that:

<ol class='xoxo'>
  <li>item 1
    <dl>
      <dt>multivalproperty1</dt>
      <dd><ul>
       <li>value-a</li>
       <li>value-b</li>
      </ul></dd>
    </dl>
  </li>
</ol>