// TODO: better error handling (avoid NPE)
bit = null;
}
Tables.Row bmk_row = null;
String urlHash;
final YMarkDate date = new YMarkDate();
while(bit.hasNext()){
// urlHash = bit.next();
bmk_row = bit.next();
urlHash = new String(bmk_row.getPK());
if(alias.contains(urlHash)) {
buffer.setLength(0);
buffer.append(YMarkXBELImporter.XBEL.ALIAS.startTag(true));
buffer.append(" ref=\"b:");
buffer.append(urlHash);
buffer.append("\"/>");
prop.put("xbel_"+count+"_elements", buffer.toString());
count++;
} else {
alias.add(urlHash);
// bmk_row = sb.tables.select(YMarkTables.TABLES.BOOKMARKS.tablename(bmk_user), urlHash.getBytes());
if(bmk_row != null) {
buffer.setLength(0);
buffer.append(YMarkXBELImporter.XBEL.BOOKMARK.startTag(true));
buffer.append(" id=\"b:");
buffer.append(urlHash);
buffer.append(YMarkEntry.BOOKMARK.URL.xbel());
buffer.append(CharacterCoding.unicode2xml(bmk_row.get(YMarkEntry.BOOKMARK.URL.key(), YMarkEntry.BOOKMARK.URL.deflt()), true));
buffer.append(YMarkEntry.BOOKMARK.DATE_ADDED.xbel());
date.set(bmk_row.get(YMarkEntry.BOOKMARK.DATE_ADDED.key()));
buffer.append(CharacterCoding.unicode2xml(date.toISO8601(), true));
buffer.append(YMarkEntry.BOOKMARK.DATE_MODIFIED.xbel());
date.set(bmk_row.get(YMarkEntry.BOOKMARK.DATE_MODIFIED.key()));
buffer.append(CharacterCoding.unicode2xml(date.toISO8601(), true));
buffer.append(YMarkEntry.BOOKMARK.DATE_VISITED.xbel());
date.set(bmk_row.get(YMarkEntry.BOOKMARK.DATE_VISITED.key()));
buffer.append(CharacterCoding.unicode2xml(date.toISO8601(), true));
buffer.append(YMarkEntry.BOOKMARK.TAGS.xbel());
buffer.append(bmk_row.get(YMarkEntry.BOOKMARK.TAGS.key(), YMarkEntry.BOOKMARK.TAGS.deflt()));
buffer.append(YMarkEntry.BOOKMARK.PUBLIC.xbel());