Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 182480
Collapse All | Expand All

(-)src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSEAdapter.java (-1 / +26 lines)
Lines 178-189 Link Here
178
			return;
178
			return;
179
		String domPath = map.getDOMPath();
179
		String domPath = map.getDOMPath();
180
180
181
		if ((!map.isManagedByParent() && !map.isDOMTextValue()) || (map.isManagedByParent() && domPath.length() != 0) && node.getNodeName().equals(domPath)) {
181
//		if ((!map.isManagedByParent() && !map.isDOMTextValue()) || (map.isManagedByParent() && domPath.length() != 0) && node.getNodeName().equals(domPath)) {
182
		if ((hasChildTag(map) && !map.isDOMTextValue()) || (map.isManagedByParent() && domPath.length() != 0) && node.getNodeName().equals(domPath)) {
182
			Text newWS = node.getOwnerDocument().createTextNode(getNewlineString(node) + indentString); //$NON-NLS-1$
183
			Text newWS = node.getOwnerDocument().createTextNode(getNewlineString(node) + indentString); //$NON-NLS-1$
183
			DOMUtilities.insertBeforeNode(node, newWS, null);
184
			DOMUtilities.insertBeforeNode(node, newWS, null);
184
		}
185
		}
185
	}
186
	}
186
187
188
	private static boolean hasChildTag(Translator map) {
189
		String name = map.getClass().getName();
190
		if (name.endsWith("GenericTranslator") || name.endsWith("WebTypeTranslator")) {
191
			
192
			Translator[] children = map.getChildren(null, -1);
193
			if (children != null) {
194
				for(int index = 0;index < children.length;index++) {
195
					String[] names = children[index].getDOMNames();
196
					for(int nameIndex = 0;nameIndex < names.length;nameIndex++) {
197
						if (names[nameIndex].equals("id") == false && names[nameIndex].equals("xml:lang") == false && names[nameIndex].equals("$TEXT_ATTRIBUTE_VALUE") == false) {
198
							return true;
199
						}
200
					}
201
					
202
				}
203
			}
204
		
205
			return false;
206
		}
207
		else {
208
			return !map.isManagedByParent();
209
		}
210
	}
211
	
187
	/**
212
	/**
188
	 * Indent before the start tag of the <node>passed in.
213
	 * Indent before the start tag of the <node>passed in.
189
	 */
214
	 */

Return to bug 182480