assume that:
- An XML document is deceptive if it maps the same namespace prefix to two different namespace URIs at different points.
- A document is confusing if it maps two different namespace prefixes to the same namespace URI in different scopes.
- A document is super-confusing if it maps two different namespace prefixes to the same URI in the same scope.
- A document is ok if it is neither deceptive nor confusing.
- A document is normal (or in namespace-normal form) if all namespace declarations appear on the root element and it is not super-confusing.
how to check the document namespaces using the standard java dom api?
someone help me...
main method:
public static void main(String[] args) {
NamespaceAnalyzer na = new NamespaceAnalyzer();
Document input = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(args[0]);
System.out.println("\tAnalysing namespaces...");
Document outputDoc = na.check(input);
...
}
public class NamespaceAnalyzer {
public NamespaceAnalyzer() {
}
public Document check(Document srcfile) {
Document naReport = null; // TODO: Build your report (output) file
// TODO: Implement
return naReport;
}
}
how to implement the check() method?