June 2000
Intermediate to advanced
556 pages
8h 45m
English
The examples I have used in this chapter combined with the fragment from the xmllib standard library strongly hint that XML can be gainfully processed with Python's regular-expression support. This is indeed the case, but a number of caveats need to be borne in mind.
Some things you can incur in an XML document can cause simple regular expression-based programs to go astray. Some of the more common “gotchas” are:
Comments
CDATA sections
General entity references
Single-quoted attribute value literals
Document-type declaration subsets
If you do not use these features of XML (and feel confident that the XML you will have to process will never contain any of them), feel free to skip this section.
An XML document ...
Read now
Unlock full access