1
2
3
4
5
6
7
8
9
10
11
12 package sk.uniba.euromath.tests;
13
14 import org.apache.xerces.parsers.DOMParser;
15 import org.apache.xerces.xni.Augmentations;
16 import org.apache.xerces.xni.XMLResourceIdentifier;
17 import org.apache.xerces.xni.XMLString;
18 import org.apache.xerces.xni.XNIException;
19 import org.w3c.dom.Document;
20
21 import sk.uniba.euromath.config.EuromathConfig;
22
23 /***
24 *
25 * @author Martin Vysny
26 */
27 public class EntityCorrectLoading extends DOMParser{
28 public static void main(String[] args) {
29 try {
30 new EntityCorrectLoading().main();
31 } catch (Exception ex) {
32 ex.printStackTrace();
33 }
34 }
35 public void main() throws Exception {
36 TestTools.printTimer();
37 System.out.println("Loading config.");
38 EuromathConfig.setPluginRoot();
39 EuromathConfig.initInstance();
40 TestTools.printTimer();
41 System.out.println("Loading document.");
42 parse("../test/mo_ex.mml");
43 Document doc=getDocument();
44 TestTools.printTimer();
45 System.out.println("Done.");
46 }
47
48
49
50 public void unparsedEntityDecl(String arg0, XMLResourceIdentifier arg1,
51 String arg2, Augmentations arg3) throws XNIException {
52 System.out.print(arg0+": ");
53 System.out.println(arg3);
54
55 super.unparsedEntityDecl(arg0, arg1, arg2, arg3);
56 }
57
58
59
60
61 public void externalEntityDecl(String arg0, XMLResourceIdentifier arg1,
62 Augmentations arg2) throws XNIException {
63 super.externalEntityDecl(arg0, arg1, arg2);
64 }
65
66
67
68 public void internalEntityDecl(String arg0, XMLString arg1, XMLString arg2,
69 Augmentations arg3) throws XNIException {
70 if(arg0.charAt(0)!='%') System.out.println(arg0+": "+arg1+"; "+arg3);
71 super.internalEntityDecl(arg0, arg1, arg2, arg3);
72 }
73 }