Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Homework 2 l Given the DTD (figure.dtd):. 2 1. Write two XML Documents conforming to the previous DTD. All elements and attributes declared in the DTD.

Similar presentations


Presentation on theme: "1 Homework 2 l Given the DTD (figure.dtd):. 2 1. Write two XML Documents conforming to the previous DTD. All elements and attributes declared in the DTD."— Presentation transcript:

1 1 Homework 2 l Given the DTD (figure.dtd):

2 2 1. Write two XML Documents conforming to the previous DTD. All elements and attributes declared in the DTD must appear at least once in each document. 2. Use DOM API to write a Java program that load an XML Document that are valid w.r.t the previous DTD as its external subset. Your program should then use java2d to draw all corresponding shapes and texts according to data given in the input XML document.

3 3 Example figure0.xml The first rectangle The first oval

4 4 Notes l For those students unfamiliar with java2d graphics, we provide an executable java2d sample program: HW23Sample.java. You can compile and execute it to see how it work. l To help grading, please name your main java classes as HW2 and HW3, respectively. Both should have a main(String[]) method accepting as input an input file name. So we can invoke them as follows: >java HW2 figure1.xml >java HW3 figure1.xml l You can subclass HW23Sample in your HW2/3 to reuse what have been supplied in it.


Download ppt "1 Homework 2 l Given the DTD (figure.dtd):. 2 1. Write two XML Documents conforming to the previous DTD. All elements and attributes declared in the DTD."

Similar presentations


Ads by Google