View | Details | Raw Unified | Return to bug 362006
Collapse All | Expand All

(-)src/org/eclipse/wst/xml/core/internal/document/ElementImpl.java (-13 / +1 lines)
Lines 264-282 Link Here
264
		if (this.attrNodes == null)
264
		if (this.attrNodes == null)
265
			return null; // no attribute
265
			return null; // no attribute
266
266
267
		final Attr attr = findAttributeNode(name);
267
		return findAttributeNode(name);
268
		if (attr != null)
269
			return attr;
270
271
		String implied = getDefaultValue(name, null);
272
		if (implied != null) {
273
			Attr createdAttribute = getOwnerDocument().createAttribute(name);
274
			createdAttribute.setNodeValue(implied);
275
			((AttrImpl) createdAttribute).setOwnerElement(this);
276
			return createdAttribute;
277
		}
278
		
279
		return null; // not found
280
	}
268
	}
281
269
282
	/**
270
	/**
(-)src/org/eclipse/wst/xml/core/tests/dom/ElementImplTests.java (-2 / +1 lines)
Lines 257-264 Link Here
257
				Element element = document.getDocumentElement();
257
				Element element = document.getDocumentElement();
258
				assertNotNull(element);
258
				assertNotNull(element);
259
				Attr attr = element.getAttributeNode("hour");
259
				Attr attr = element.getAttributeNode("hour");
260
				assertNotNull(attr);
260
				assertNull(attr);
261
				assertEquals("Attribute should be owned by its element.", element, attr.getOwnerElement());
262
			}
261
			}
263
		}
262
		}
264
		finally {
263
		finally {

Return to bug 362006