Support "trim" attribute at the element. It is an optional attribute and is defaulted to true (i.e. trimmable).
This commit is contained in:
parent
d421ce00e2
commit
b9c3f19c84
|
@ -300,11 +300,15 @@ public class PackInHandler extends DefaultHandler {
|
||||||
if (e.contents != null && e.contents.length() > 0)
|
if (e.contents != null && e.contents.length() > 0)
|
||||||
{
|
{
|
||||||
if (e.contents.toString().length() != e.contents.toString().trim().length())
|
if (e.contents.toString().length() != e.contents.toString().trim().length())
|
||||||
|
{
|
||||||
|
String trim = e.attributes.getValue("trim");
|
||||||
|
if (!(trim != null && trim.equals("false")))
|
||||||
{
|
{
|
||||||
String s = e.contents.toString().trim();
|
String s = e.contents.toString().trim();
|
||||||
e.contents = new StringBuffer(s);
|
e.contents = new StringBuffer(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (stack.isEmpty())
|
if (stack.isEmpty())
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue