From 457ce3fb7d0bd2198d1397912093cc1f99befe26 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Wed, 7 Sep 2011 18:01:38 +0200 Subject: Use HTML5 elements for header, hgroup, nav(bar), footer. --- org/madore/damlengine/TodoDamlElement.java | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'org/madore/damlengine/TodoDamlElement.java') diff --git a/org/madore/damlengine/TodoDamlElement.java b/org/madore/damlengine/TodoDamlElement.java index 5237d91..93275d9 100644 --- a/org/madore/damlengine/TodoDamlElement.java +++ b/org/madore/damlengine/TodoDamlElement.java @@ -95,34 +95,40 @@ public final class TodoDamlElement extends TodoDefaultElement { ArrayList childList = getChildList(this.node); ArrayList toProcessFirst = new ArrayList(); ArrayList toProcess = new ArrayList(childList.size()+8); + Element header = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "header"); + bodyNode.appendChild(ctx.doc.createTextNode("\n")); + bodyNode.appendChild(header); + Element hgroup = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "hgroup"); + header.appendChild(ctx.doc.createTextNode("\n")); + header.appendChild(hgroup); if ( node.getAttributeNS(null, "notitle").equals("") ) { Element token = ctx.doc.createElementNS(DamlEngine.DAML_NS, "d:implicit-do-title"); - bodyNode.appendChild(ctx.doc.createTextNode("\n")); - bodyNode.appendChild(token); + hgroup.appendChild(ctx.doc.createTextNode("\n")); + hgroup.appendChild(token); toProcess.add(new TodoTitleOrSubtitle(TodoTitleOrSubtitle.Type.TITLE, token, this.ctx, this)); } if ( node.getAttributeNS(null, "nosubtitle").equals("") ) { Element token = ctx.doc.createElementNS(DamlEngine.DAML_NS, "d:implicit-do-subtitle"); - bodyNode.appendChild(ctx.doc.createTextNode("\n")); - bodyNode.appendChild(token); + hgroup.appendChild(ctx.doc.createTextNode("\n")); + hgroup.appendChild(token); toProcess.add(new TodoTitleOrSubtitle(TodoTitleOrSubtitle.Type.SUBTITLE, token, this.ctx, this)); } if ( node.getAttributeNS(null, "nonavbar").equals("") ) { Element token = ctx.doc.createElementNS(DamlEngine.DAML_NS, "d:implicit-do-navbar"); - bodyNode.appendChild(ctx.doc.createTextNode("\n")); - bodyNode.appendChild(token); + header.appendChild(ctx.doc.createTextNode("\n")); + header.appendChild(token); toProcess.add(new TodoNavbar(token, this.ctx, this)); } if ( node.getAttributeNS(null, "notranslations").equals("") ) { Element token = ctx.doc.createElementNS(DamlEngine.DAML_NS, "d:implicit-do-translations"); - bodyNode.appendChild(ctx.doc.createTextNode("\n")); - bodyNode.appendChild(token); + header.appendChild(ctx.doc.createTextNode("\n")); + header.appendChild(token); toProcess.add(new TodoTranslations(token, this.ctx, this)); } for ( Node child : childList ) { -- cgit v1.2.3