forked from I2P_Developers/i2p.i2p
dont add whitespace to XHTML output
This commit is contained in:
@ -146,8 +146,7 @@ public class XMLParser extends JaxpParser {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String indentString = node.getIndentLevelString(indentLevel);
|
buf.append('<').append(name);
|
||||||
buf.append(indentString).append('<').append(name);
|
|
||||||
int nAttributes = node.getNAttributes();
|
int nAttributes = node.getNAttributes();
|
||||||
for (int n = 0; n < nAttributes; n++) {
|
for (int n = 0; n < nAttributes; n++) {
|
||||||
Attribute attr = node.getAttribute(n);
|
Attribute attr = node.getAttribute(n);
|
||||||
@ -157,18 +156,20 @@ public class XMLParser extends JaxpParser {
|
|||||||
// As in Node, output either the nodes or the value.
|
// As in Node, output either the nodes or the value.
|
||||||
// If mixed values and nodes, the values must be text nodes. See parser above.
|
// If mixed values and nodes, the values must be text nodes. See parser above.
|
||||||
if (node.hasNodes()) {
|
if (node.hasNodes()) {
|
||||||
buf.append(">\n");
|
buf.append('>');
|
||||||
int nChildNodes = node.getNNodes();
|
int nChildNodes = node.getNNodes();
|
||||||
for (int n = 0; n < nChildNodes; n++) {
|
for (int n = 0; n < nChildNodes; n++) {
|
||||||
Node cnode = node.getNode(n);
|
Node cnode = node.getNode(n);
|
||||||
output(buf, cnode, indentLevel + 1);
|
output(buf, cnode, indentLevel + 1);
|
||||||
}
|
}
|
||||||
buf.append(indentString).append("</").append(name).append(">\n");
|
buf.append("</").append(name).append('>');
|
||||||
} else {
|
} else {
|
||||||
if (value == null || value.length() == 0)
|
if (value == null || value.length() == 0) {
|
||||||
buf.append("/>");
|
// space for <br />
|
||||||
else
|
buf.append(" />");
|
||||||
|
} else {
|
||||||
buf.append('>').append(value).append("</").append(name).append('>');
|
buf.append('>').append(value).append("</").append(name).append('>');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user