any23-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Potter <>
Subject Mircodata empty content handling.
Date Mon, 30 Apr 2012 11:15:59 GMT
   We've noticed that while extracting Microdata propItems, elements with missing, empty or
whitespace string values results in an IllegalArgumentException being thrown.

HTML that trigger this could be one of:

<span itemprop="nameA"></span>

<meta itemprop="nameB">

<meta itemprop="nameC" content="  ">

The code explicitly check for this condition in ItemPropValue.itemPropValue():

if(content instanceof String && ((String) content).trim().length() == 0) {

    throw new IllegalArgumentException("Invalid content '" + content + "'");


Is this correct behavior?  Is it not possible that some properties could legally have an empty
string as a value?  I looked at the RFC and it seems that having no value should be treated
as an empty string, but it doesn't state that empty values are illegal.

  Tim P.

View raw message