Skip to content

Commit 429dad6

Browse files
author
Shachar Shemesh
committed
Normalize output from aapt d xmltree
When using aapt dump xmltree to dump an XML which has a content element with newlines, the output contains a newline. This makes it very difficult, sometimes impossible, to understand what is part of the content, and what is the meta-data. We now pass XML content through the same normalizer used for other tags. Change-Id: I327321520fac563eb32aecaf796f2473866697fc
1 parent dc99555 commit 429dad6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/aapt/XMLNode.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ void printXMLBlock(ResXMLTree* block)
511511
namespaces.pop();
512512
} else if (code == ResXMLTree::TEXT) {
513513
size_t len;
514-
printf("%sC: \"%s\"\n", prefix.string(), String8(block->getText(&len)).string());
514+
printf("%sC: \"%s\"\n", prefix.string(),
515+
ResTable::normalizeForOutput(String8(block->getText(&len)).string()).string());
515516
}
516517
}
517518

0 commit comments

Comments
 (0)