| 521 | } |
| 522 | |
| 523 | status_t parseXMLResource(const sp<AaptFile>& file, ResXMLTree* outTree, |
| 524 | bool stripAll, bool keepComments, |
| 525 | const char** cDataTags) |
| 526 | { |
| 527 | sp<XMLNode> root = XMLNode::parse(file); |
| 528 | if (root == NULL) { |
| 529 | return UNKNOWN_ERROR; |
| 530 | } |
| 531 | root->removeWhitespace(stripAll, cDataTags); |
| 532 | |
| 533 | NOISY(printf("Input XML from %s:\n", (const char*)file->getPrintableSource())); |
| 534 | NOISY(root->print()); |
| 535 | sp<AaptFile> rsc = new AaptFile(String8(), AaptGroupEntry(), String8()); |
| 536 | status_t err = root->flatten(rsc, !keepComments, false); |
| 537 | if (err != NO_ERROR) { |
| 538 | return err; |
| 539 | } |
| 540 | err = outTree->setTo(rsc->getData(), rsc->getSize(), true); |
| 541 | if (err != NO_ERROR) { |
| 542 | return err; |
| 543 | } |
| 544 | |
| 545 | NOISY(printf("Output XML:\n")); |
| 546 | NOISY(printXMLBlock(outTree)); |
| 547 | |
| 548 | return NO_ERROR; |
| 549 | } |
| 550 | |
| 551 | sp<XMLNode> XMLNode::parseFromZip(const sp<AaptFile>& file) { |
| 552 | AssetManager assets; |
no test coverage detected