public static void build(PrefixMapping newMappings, Item elt)
{
if ( ! elt.isList() )
BuilderLib.broken(elt, "Prefix mapping requires a list of pairs", elt) ;
ItemList prefixes = elt.getList() ;
// Strip (prefixmapping ...)
if ( elt.isTaggedIgnoreCase(Tags.tagPrefixMap) || elt.isTaggedIgnoreCase(Tags.tagPrefixMapping) )
{
BuilderLib.checkLength(2, elt.getList(), "Not of length 2"+elt.shortString()) ;
// drop the tag
prefixes = prefixes.cdr();
}
for (Item pair : prefixes)
{
if ( !pair.isList() || pair.getList().size() != 2 )