June 2000
Intermediate to advanced
556 pages
8h 45m
English
At the beginning of this chapter, we saw three examples of searches that require hierarchical context. In the short sections below, solutions to these three queries are illustrated.
We use the following small staff file to illustrate this query.
CD-ROM reference=9035.txt
C>type staff.xml
<staff>
<department name="Technical">
<person>
<title>Technical Director</title>
<name>
<given>Sean</given>
<family>McGrath</family>
</name>
<email>Sean@digitome.com</email>
<web>http://www.digitome.com/Sean.html</web>
</person>
</department>
</staff>
We can use the xgrep –ancestor switch to restrict the match for “Sean” to be within name elements only:
CD-ROM reference=9036.txt
C>python ...Read now
Unlock full access