I have been assigned a project in software engineering a part of which is verifying the syntax of an xml file and then create a custom data model. A sample of this xml syntax is :
which means that in the c source file TestProgram.c there is a function named f1 which calls (uses) f2 and f3.
I currently try to work with DocumentBuilder like this:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
System.out.println("Trying to parse file...");
Document document = db.parse(this.file);
}/* try */
which complains about "f1" being inside the "Function" tag. If I get this "f1" outside the tag, eg
it works ok. Is there a way to check the syntax and parse the file without changing xml source file using an already existing class? Or I have to write a new syntax verification/parser myself?
Thanks in advance for any help.