Fields Collection Element

Field Element

The
FieldElement defines what data the parser should look for in the input stream. Take the following field declaration as an example
<Field name="bday" rootType="class" dataType="System.String" plurality="Singular"/>.

The name attribute is the exact representation of the attibute value that the parser looks for in the input stream (i.e. If an html element is as follows: <li class="bday">03-06-1960</li> the parser will include the data in the
associated Microformat).

The rootType attribute defines the attribute that the parser will look for the specified name value on an sgml element ((i.e. If an html element is as follows: <li
class="bday">03-06-1960</li> the parser will search the class attibute for the field defined by the name).

The dataType attribute tells the parser how to read the values out of the input stream.
Current dataType values are:

Microformat - defines a nested microformat

System.String - the parser will treat data as a string

System.Uri - the parser will treat data as a Uri

The plurality attribute informs the parser how to treat data.Warning: specifiying a pluraity of Singular does not yet ignore multiple instances of the field

Notice the differences above, in the second example the given-name and family name are outside the "n" elements tree.

Nested Microformats

Each Microformat configuration can point to another configured microformat. A nested microformat must be configured, before it is refernced inside another microformat. For example, take the hCard Microformat, it contains two nested microformats, GEO (Geographic
Reference points) and ADR (Address information). They are configured referenced in the hCard as a field with a dataType of "Microformat" (<Field name="adr" rootType="class" dataType="Microformat"
plurality="Plural"/>). The framework will reconise that it needs to then find the Microformat called ADR and then resolve all the ADR fields into the hCard format.Warning: It is possible to create an infinite loop of nested formats, with both Microformats refering to each other.