From 7fb2155a48f7312ff71bc841ce587c44f333384b Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Wed, 7 Sep 2011 14:51:59 +0200 Subject: Fix and correct some aspects of language handling. In particular, take better care to ensure that when an element is removed which might have an xml:lang attribute, its children keep their original language. --- org/madore/damlengine/TodoBodyElement.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'org/madore/damlengine/TodoBodyElement.java') diff --git a/org/madore/damlengine/TodoBodyElement.java b/org/madore/damlengine/TodoBodyElement.java index 1db657b..2e48ee8 100644 --- a/org/madore/damlengine/TodoBodyElement.java +++ b/org/madore/damlengine/TodoBodyElement.java @@ -27,6 +27,7 @@ public final class TodoBodyElement extends TodoDefaultElement { throw new IllegalArgumentException("body node can only be child of daml node"); Element parent = (Element)(this.node.getParentNode()); + String explicitLang = LangHelper.getLangNorec(this.node); ArrayList childList = getChildList(this.node); ArrayList toProcess = new ArrayList(childList.size()); for ( Node child : childList ) { @@ -37,6 +38,8 @@ public final class TodoBodyElement extends TodoDefaultElement { } parent.insertBefore(child, node); if ( child.getNodeType() == Node.ELEMENT_NODE ) { + if ( explicitLang != null ) + LangHelper.setWeakLangNorec((Element)child, explicitLang); TodoElement it = TodoElement.getTodoElement((Element)child, this.ctx, this); toProcess.add(it); -- cgit v1.2.3