My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
MicroformatDefinitions  
Updated Oct 2, 2008 by martinez...@gmail.com

#Properties of the microformats definitions for XMFP.

How to add new Microformat definitions to XMFP

XMFP is constructed on a very simple idea, which is: structure determines parsing. In this sense we provide XMFP with a definition of the structure of the microformats we want to parse from a webpage and XMFP will adapt and find the Microformats based on this definitions. I think about it this way: At it's more structural basic, an HTML ( or XHTML or XML ) document is a tree, it starts with one node, namely the html tag, which has a variety of subnodes which themselves can also have subnodes. I think of Microformats as some sort of fungus that resides on top of the nodes of this tree, the interesting thing is that compund microformats themselves have a tree structure, they start with the root element class ( for example hCard ) and within the nodes that the HTML node of this class contains, there exists another structure with properties and subproperties. So what does this have to do with XMFP? Well, if we want to make XMFP aware of a microformat, we simple add a new microformat definition. ( In a perfect world, this would be automated, meaning that I should be able to get a document with the structure of the Microformat, rather than having to do this by hand, specially if we believe ( like I do ) that the semantic web is to become polysemic and not limited to just an small and finite but well defined set of idioms ).

Propeties of the Microformat Definition

Array Index : Name of the property that must be found among the class attribute values of the HTML element

  • ocurrences : Number of times the property must or can appear. Defaults to
    • 1 Must be present exactly one
    • Optional, may occurr more than once
    • + Must occur, maybe more than once
    • ? Optional, if occurs it must be only once
  • sempopt Semantic Optimizations.
    • tag HTML Tag from which the value might be taken
    • att Attribute from which the value might be taken
  • childs The array of child properties that an element must contain. As such they must exist only within the parent element.
  • postprocessing Array of the postprocessing functions the microformat parser must apply to the raw value picked. They are dependent of the specific property.
  • skip Wether or not to skip the element when parsing the microformat. This is done so that subproperties that might be a microformat (for example an hCard within an hReview) are not picked up as independent microformats.
  • letpass This is a Hack for properties that might be inside a property with the same name, for example, org in hCard that might be a simple value property or might have subproperties.


Sign in to add a comment
Powered by Google Project Hosting