From ced5a5f3fad721da1dab1ab90fa8599078eb4c1e Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Wed, 31 Aug 2011 23:27:26 +0200 Subject: Add a lang attribute besides xml:lang for HTML4 compatibility. --- org/madore/damlengine/Unparser.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org/madore/damlengine/Unparser.java b/org/madore/damlengine/Unparser.java index 0eeec00..87945c6 100644 --- a/org/madore/damlengine/Unparser.java +++ b/org/madore/damlengine/Unparser.java @@ -76,8 +76,11 @@ public final class Unparser { Node n2; for ( int i=0 ; (n2=attrs.item(i)) != null ; i++ ) { Attr attr = (Attr)n2; - out.write(" "+attr.getName()+"=\""+quote(attr.getValue())+"\""); - + String aname = attr.getName(); + out.write(" "+aname+"=\""+quote(attr.getValue())+"\""); + if ( aname.equals("xml:lang") + && elt.getNamespaceURI().equals(DamlEngine.XHTML_NS) ) + out.write(" lang=\""+quote(attr.getValue())+"\""); } } if ( ! elt.hasChildNodes() && ( qname.equals("br") || qname.equals("hr") -- cgit v1.2.3