8.12. In Conclusion
We have seen how the event-driven approach cuts out a lot of potential trouble spots for processing XML by leaving the handling of XML syntax in the safe hands of an XML parser.
We now have a version of xgrep that doubles as a plain text grepping tool and an XML-aware grepping tool. It has its faults, but even as it stands, it is a useful utility.
In the next chapter, we will extend xgrep further, but for now, we close out this chapter with a couple of small changes to xgrep.
Before we finish this chapter, we will improve the PrintMatch function. Currently, it prints its output on standard output with the print statement. This is likely to be a less-than-perfect behavior when the module is imported into larger programs, especially ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access