1SAX.setDocumentLocator()
2SAX.startDocument()
3SAX.internalSubset(EXAMPLE, , example.dtd)
4SAX.entityDecl(xml, 1, (null), (null), Extensible Markup Language)
5SAX.getEntity(xml)
6SAX.entityDecl(title, 2, -//MY-TITLE//FR, title.xml, (null))
7SAX.unparsedEntityDecl(image, (null), img.gif, GIF)
8SAX.externalSubset(EXAMPLE, , example.dtd)
9SAX.startElementNs(EXAMPLE, NULL, NULL, 0, 0, 0)
10SAX.characters(
11  , 3)
12SAX.getEntity(title)
13SAX.ignorableWhitespace(
14, 1)
15SAX.startElementNs(title, NULL, NULL, 0, 0, 0)
16SAX.characters(my title, 8)
17SAX.endElementNs(title, NULL, NULL)
18SAX.characters(
19, 1)
20SAX.characters(
21  This text is about XML, the, 31)
22SAX.getEntity(xml)
23SAX.characters(Extensible Markup Language, 26)
24SAX.characters( and this is an embedded , 25)
25SAX.startElementNs(IMG, NULL, NULL, 0, 1, 0, src='imag...', 5)
26SAX.endElementNs(IMG, NULL, NULL)
27SAX.characters(
28, 1)
29SAX.endElementNs(EXAMPLE, NULL, NULL)
30SAX.endDocument()
31