Step 5
I put the files, as_you.txt, as_you_SAX_parser.py, XML_pullDOM_parser.py and play.dtd, at the same folder. Then I execute as_you_SAX_parser.py by IDLE and the output it displayed the dialogue of each actor in pre-assigned order while DOM just displayed one script only.
SAX’s Result:
ROSALIND
That he hath not.
CELIA
No, hath not? Rosalind lacks then the love
Which teacheth thee that thou and I am one:
Shall we be sunder’d? shall we part, sweet girl?
No: let my father seek another heir.
Therefore devise with me how we may fly,
Whither to go and what to bear with us;
And do not seek to take your change upon you,
To bear your griefs yourself and leave me out;
For, by this heaven, now at our sorrows pale,
Say what thou canst, I’ll go along with thee.
ROSALIND
Why, whither shall we go?
CELIA
To seek my uncle in the forest of Arden.
When I ran XML_pullDOM_parser.py, the output is:
DOM’s Result:
Which is he that killed the deer?
Step 6.
I can find miniDOM and pullDOM only.
Step 10.
Both entrance and exit are in red.
Step 12
Nodes, like Title, Stagedir, are needed to generate actor tools as well as node, line, is for actors’ script.
Step 13
We can do client side XSLT styling because client-side XSLT processing has been available in IE s.
Step 15
Both as_you.xml and two_gent.xml have the similar tree structure. Therefore, I add the line, <?xml-stylesheet href=”play.xsl” type=”text/xsl”?> in the beginning of two_gent.xml. It produced the output as follows:
