From 5d04d7e32ab93c6b3c3ec7e3698f0a41b55fa4cb Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Wed, 7 Sep 2011 18:24:44 +0200 Subject: Also use HTML5 elements (article, header, footer) for weblog entries. --- org/madore/damlengine/TodoEntryElement.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'org/madore/damlengine/TodoEntryElement.java') diff --git a/org/madore/damlengine/TodoEntryElement.java b/org/madore/damlengine/TodoEntryElement.java index 78bffd1..7365b88 100644 --- a/org/madore/damlengine/TodoEntryElement.java +++ b/org/madore/damlengine/TodoEntryElement.java @@ -28,7 +28,7 @@ public final class TodoEntryElement extends TodoDefaultElement { || caller instanceof TodoWeblogSelectElement ) ) throw new IllegalArgumentException("entry node can only be child of weblog node"); - Element div = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "div"); + Element div = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "article"); String explicitLang = LangHelper.getLangNorec(node); if ( explicitLang != null ) LangHelper.setLangNorec(div, explicitLang); @@ -56,25 +56,29 @@ public final class TodoEntryElement extends TodoDefaultElement { } div.appendChild(ctx.doc.createTextNode("\n")); - Element header = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "p"); - header.setAttributeNS(null, "class", "weblog-entry-header"); + Element header = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "header"); div.appendChild(header); div.appendChild(ctx.doc.createTextNode("\n")); + Element headlink = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "p"); + headlink.setAttributeNS(null, "class", "weblog-entry-headlink"); + header.appendChild(headlink); + header.appendChild(ctx.doc.createTextNode("\n")); Element permalink = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "a"); permalink.setAttributeNS(null, "href", entryYearStr+"-"+entryMonthStr+".html" +"#"+entryIdStr); permalink.appendChild(ctx.doc.createTextNode(entryDateStr)); - header.appendChild(permalink); + headlink.appendChild(permalink); if ( ! entryDowStr.equals("") ) - header.appendChild(ctx.doc.createTextNode(" ("+entryDowStr+")")); + headlink.appendChild(ctx.doc.createTextNode(" ("+entryDowStr+")")); Context ctx2 = ctx.clone(); ctx2.ent = new Context.EntryContext(entryYearStr, entryMonthStr, entryDayStr, entryNumberStr, entryDowStr); ctx2.ent.headerNode = header; + ctx2.ent.headlinkNode = headlink; ArrayList childList = getChildList(this.node); ArrayList toProcess = new ArrayList(childList.size()+8); -- cgit v1.2.3