OSDN Git Service

AAPT2: XML configuration file parser.
authorShane Farmer <safarmer@google.com>
Fri, 12 May 2017 23:22:36 +0000 (16:22 -0700)
committerShane Farmer <safarmer@google.com>
Wed, 31 May 2017 23:18:31 +0000 (16:18 -0700)
commit74cdea34cd6dce8bf9b4adaa2cd7cb02330120d5
treefb33d7640471c3e5164333e188970630757d6513
parent14c991cf97ec2505ff30d8fbb29f241a846feafe
AAPT2: XML configuration file parser.

The XML file is parsed with the aapt::xml::XmlDom parser and actions are
used for the elements we are interested in. This means that there are
cases where a user could add aditional tags/elements to the document
that are technically invalid (acording to the schema) but are ignored by
the parser. This allows us to be more lenient which probably isn't a bad
thing.

Documents have the namespace stripped before processing as the
XmlActionExecutor ignores any elements with a namespace. The namespace
is validated before being removed.

The test cases are all based off the previous example XML file.

Test: Unit tests

Change-Id: I86d7e0dc6347ace3eaa60c1842d59f3cd0d4f749
tools/aapt2/Android.bp
tools/aapt2/configuration/ConfigurationParser.cpp [new file with mode: 0644]
tools/aapt2/configuration/ConfigurationParser.h [new file with mode: 0644]
tools/aapt2/configuration/ConfigurationParser_test.cpp [new file with mode: 0644]