Suppose the XML file is:
<class name=math>
<student>luke1</student>
...
<student>luke8000000</student>
</class>
<class name=english>
<student>mary1</student>
...
<student>mary1000000</student>
</class>
after class=math
is parsed, I want to delete this element from the XML file so that when class=english
is parsed, Twig will not go through the content of class=math
.
The reason I want to do this is that, so far even if I use TwigRoots => {"class[\@name='english']" => \&counter}
I still need to wait a long time for Twig to start to parse class=english
because it needs to go over each line of class=math
(correct me if it does not need to go over each line). In the actual file I run, there are several classes, I do not want to let Twig go through each line in class=math
before finding the class it is really interested in.
Thanks in advance.