Author: scabanovich
Date: 2009-03-30 11:18:54 -0400 (Mon, 30 Mar 2009)
New Revision: 14370
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java
Log:
JBIDE-4101
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java 2009-03-30
14:52:26 UTC (rev 14369)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/XModelObjectLoaderUtil.java 2009-03-30
15:18:54 UTC (rev 14370)
@@ -217,7 +217,7 @@
String xmlname = as[i].getXMLName();
if (xmlname == null || xmlname.length() == 0) continue;
String n = as[i].getName();
- String value = getAttribute(element, xmlname);
+ String value = getAttribute(element, xmlname, as[i]);
if (value != null) o.setAttributeValue(n, value);
String commentName = getAttributeCommentName(xmlname);
if(commentName != null) {
@@ -257,9 +257,14 @@
return xmlname;
}
+ //TODO final. getAttribute(Element, String, XAttribute) should be overridden
public String getAttribute(Element element, String xmlname) {
+ return getAttribute(element, xmlname, null);
+ }
+
+ public String getAttribute(Element element, String xmlname, XAttribute attr) {
if (xmlname.equals("CDATA") || xmlname.equals("#text")) {
- return getCDATA(element, true);
+ return getCDATA(element, attr == null || attr.isTrimmable());
} else if (xmlname.equals("#comment")) {
return getComment(element);
} else {
@@ -273,7 +278,7 @@
childName = namespace + ":" + childName;
}
Element child = XMLUtil.getFirstChild(element, childName);
- if (child != null) return getAttribute(child, xmlname.substring(ind+1));
+ if (child != null) return getAttribute(child, xmlname.substring(ind+1), attr);
} else {
xmlname = applyNamespaceToAttribute(xmlname);
if (XMLUtil.hasAttribute(element, xmlname)) {
Show replies by date