
330 • XML & Related Technologies
Let us come back to XML. Which of the approaches should we use now? Should we ask our application
program to read the next n bytes every time, or say something like, read the next element? If we go via the n
bytes approach, we need to know how many bytes to read every time. Also, remember that apart from reading
the next n bytes, we also need to know where an element begins, where it ends, whether all its attributes are
declared properly, whether the corresponding end element tag for this element is properly defined, whether
all the sub-elements (if any) are correctly defined, and so on! Moreover, we also need ...