microformat-shiv.js
function( options ) {
			var out = {},
				items,
				classItems,
				x,
				i;

			this.init();
			options = (options)? options : {};
			this.getDOMContext( options );

			// if we do not have any context create error
			if(!this.rootNode || !this.document){
				return {'errors': [this.noContentErr]};
			}else{

				items = this.findRootNodes( this.rootNode, true );
				i = items.length;
				while(i--) {
					classItems = modules.domUtils.getAttributeList(items[i], 'class');
					x = classItems.length;
					while(x--) {
						// find v2 names
						if(modules.utils.startWith( classItems[x], 'h-' )){
							this.appendCount(classItems[x], 1, out);
						}
						// find v1 names
						for(var key in modules.maps) {
							// dont double count if v1 and v2 roots are present
							if(modules.maps[key].root === classItems[x] && classItems.indexOf(key) === -1) {
								this.appendCount(key, 1, out);
							}
						}
					}
				}
				var relCount = this.countRels( this.rootNode );
				if(relCount > 0){
					out.rels = relCount;
				}

				return out;
			}
		}
function( options ) {
			var out = {},
				items,
				classItems,
				x,
				i;

			this.init();
			options = (options)? options : {};
			this.getDOMContext( options );

			// if we do not have any context create error
			if(!this.rootNode || !this.document){
				return {'errors': [this.noContentErr]};
			}else{

				items = this.findRootNodes( this.rootNode, true );
				i = items.length;
				while(i--) {
					classItems = modules.domUtils.getAttributeList(items[i], 'class');
					x = classItems.length;
					while(x--) {
						// find v2 names
						if(modules.utils.startWith( classItems[x], 'h-' )){
							this.appendCount(classItems[x], 1, out);
						}
						// find v1 names
						for(var key in modules.maps) {
							// dont double count if v1 and v2 roots are present
							if(modules.maps[key].root === classItems[x] && classItems.indexOf(key) === -1) {
								this.appendCount(key, 1, out);
							}
						}
					}
				}
				var relCount = this.countRels( this.rootNode );
				if(relCount > 0){
					out.rels = relCount;
				}

				return out;
			}
		}
function ( options ) { var out = { } , items , classItems , x , i ; this . init ( ) ; options = ( options ) ? options : { } ; this . getDOMContext ( options ) ; // if we do not have any context create error if ( ! this . rootNode || ! this . document ) { return { 'errors' : [ this . noContentErr ] } ; } else { items = this . findRootNodes ( this . rootNode , true ) ; i = items . length ; while ( i -- ) { classItems = modules . domUtils . getAttributeList ( items [ i ] , 'class' ) ; x = classItems . length ; while ( x -- ) { // find v2 names if ( modules . utils . startWith ( classItems [ x ] , 'h-' ) ) { this . appendCount ( classItems [ x ] , 1 , out ) ; } // find v1 names for ( var key in modules . maps ) { // dont double count if v1 and v2 roots are present if ( modules . maps [ key ] . root === classItems [ x ] && classItems . indexOf ( key ) === - 1 ) { this . appendCount ( key , 1 , out ) ; } } } } var relCount = this . countRels ( this . rootNode ) ; if ( relCount > 0 ) { out . rels = relCount ; } return out ; } }
get the count of microformats

@param  {DOM Node} rootNode
@return {Int}
get the count of microformats