Dao: in this package, operations are performed on the file directly. the main method can call the method in this package to operate the XML file. corresponding program: project: TestDoProject
Program: javaWeb day01
1. learn to program a project in modules: This program is divided into four modules: dao, doMain, tool, and view.
-
Dao: the content in this package stores the fatigue of directly operating the file. the main method can call the method in this package to operate the XML file;
-
DoMain: This package is the constructor package.
-
Tool: This package is a toolkit. you can write the tool class you want to use into this package to facilitate program calling, instead of having to repeat the code each time;
-
View: This package contains the interface class for dealing with users. the main class is here;
2. frequently used in this program:
3. problems:
-
During design deletion, an error is reported because no changes are written to the document at the end;
-
When designing a search, the video prompts a null pointer exception when using attribute because exam_id is an attribute and my name is a tag;
-
During the design search, the system prompts a null pointer exception due to the ";" plus "{}" position error after the for, and debugging takes a long time.
4. check whether the program syntax or structure is incorrect when solving the problem, and solve the problem first.
The above is the detailed description of adding, deleting, querying, modifying, and programming for an XML document. For more information, see other related articles in the first PHP community!