h-adr parsing tests

This page was design to test the parsing of mark-up which mixes version 1 and 2 microformats. These tests are part of the micorformats 2 test suite.

Theses are backwards compatibility tests for the older version 1 microformats specification. Please do not use this as a reference for authoring microformats.

Roots from two versions (h-card parsing test)

Frances Berriman

The expected JSON output:


{
    "items": [{
        "type": ["h-card"],
        "properties": {
            "name": ["Frances Berriman"]
        }
    }]
}

Mixed propertries form different versions (h-card parsing test)

Mozilla Foundation

665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A.

The expected JSON output:


{
    "items": [{
        "type": ["h-card"],
        "properties": {
            "name": ["Mozilla Foundation"],
            "org": ["Mozilla Foundation"],
            "url": ["http://mozilla.org/"],
            "adr": [{
                "value": "665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A.",
                "type": ["h-adr"],
                "properties": {
                    "street-address": ["665 3rd St."], 
                    "extended-address": ["Suite 207"], 
                    "locality": ["San Francisco"], 
                    "region": ["CA"], 
                    "postal-code": ["94107"], 
                    "country-name": ["U.S.A."], 
                    "name": ["665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A."]
                }
            }]
        }
    }]
}

Mixed roots form different versions (h-resume parsing test)

Tim Berners-Lee

Director of the World Wide Web Foundation

Invented the World Wide Web.


Director

World Wide Web Foundation

– Present

The expected JSON output:


{
    "items": [{
        "type": ["h-resume"],
        "properties": {
            "contact": [{
                "value": "Tim Berners-Lee Director of the World Wide Web Foundation",
                "type": ["h-card"],
                "properties": {
                    "name": ["Tim Berners-Lee"],
                    "title": ["Director of the World Wide Web Foundation"]
                }
            }],
            "summary": ["Invented the World Wide Web."],
            "experience": [{
                "value": "Director World Wide Web Foundation Jan 2009 - Present (2 years 11 month)",
                "type": ["h-event", "h-card"],
                "properties": {
                    "org": ["World Wide Web Foundation"],
                    "name": ["World Wide Web Foundation"],
                    "url": ["http://www.webfoundation.org/"],
                    "start": ["2009-01-18"],
                    "duration": ["P2Y11M"],
                    "title": ["Director"]
                }
            }]
        }
    },{
        "type": ["h-card"],
        "properties": {
            "name": ["Tim Berners-Lee"],
            "title": ["Director of the World Wide Web Foundation"]
        }
    },{
        "type": ["h-event"],
        "properties": {
            "org": ["World Wide Web Foundation"],
            "name": ["World Wide Web Foundation"],
            "url": ["http://www.webfoundation.org/"],
            "start": ["2009-01-18"],
            "duration": ["P2Y11M"]
        }
    },{
        "type": ["h-card"],
        "properties": {
            "title": ["Director"],
            "name": ["World Wide Web Foundation"],
            "org": ["World Wide Web Foundation"],
            "url": ["http://www.webfoundation.org/"]
        }
    }]
}

Change log:

Contributors :