|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2003, 2007 IBM Corporation and others. |
2 |
* Copyright (c) 2003, 2009 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 87-95
Link Here
|
| 87 |
messageLabel.setText(Messages.xmlViewInvalid); |
87 |
messageLabel.setText(Messages.xmlViewInvalid); |
| 88 |
return; |
88 |
return; |
| 89 |
} |
89 |
} |
| 90 |
if (xmlTagMissing && finalMsg.toLowerCase().startsWith("<?xml version=\"1.0\" encoding=\"utf-8\"?>")) { |
90 |
if (xmlTagMissing && (finalMsg.toLowerCase().startsWith("<?xml version=\"1.0\" encoding=\"utf-8\"?>") |
| 91 |
int x = finalMsg.indexOf("\n") + 1; |
91 |
|| finalMsg.toLowerCase().startsWith("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>") |
|
|
92 |
|| finalMsg.toLowerCase().startsWith("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>"))) { |
| 93 |
int x = finalMsg.indexOf(">") + 1; |
| 94 |
//remove <?xml version="1.0" encoding="UTF-8"?> |
| 92 |
String Msg = finalMsg.substring(x); |
95 |
String Msg = finalMsg.substring(x); |
|
|
96 |
//remove starting newlines |
| 97 |
while (Msg.substring(0, ls).indexOf(lineSeparator) >= 0){ |
| 98 |
Msg = Msg.substring(ls, Msg.length()); |
| 99 |
} |
| 93 |
finalMsg = Msg; |
100 |
finalMsg = Msg; |
| 94 |
|
101 |
|
| 95 |
messageText.setText(finalMsg); |
102 |
messageText.setText(finalMsg); |
|
Lines 211-216
Link Here
|
| 211 |
Transformer transformer = tf.newTransformer(); |
218 |
Transformer transformer = tf.newTransformer(); |
| 212 |
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ |
219 |
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ |
| 213 |
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ |
220 |
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ |
|
|
221 |
transformer.setOutputProperty(OutputKeys.STANDALONE, "no"); //$NON-NLS-1$ |
| 214 |
transformer.transform(source, result); |
222 |
transformer.transform(source, result); |
| 215 |
} catch (TransformerConfigurationException e) { |
223 |
} catch (TransformerConfigurationException e) { |
| 216 |
throw (IOException) (new IOException().initCause(e)); |
224 |
throw (IOException) (new IOException().initCause(e)); |