but in DocumentBuilderFactory, we can setNamespaceAware(false), what does this method do? I try it..but when i getTagName(), still return me "a:A"..
Setting the namespace-aware property indicates a preference to the factory class. I believe the factory is allowed to return a more advanced implementation than requested (i.e. more supported features such as validation, namespaces, etc.) but not the opposite way around. Not sure though.
and same in DocumentBuilderFactory, we can setValidating(boolean), this will validate xml againt what?
If the XML document refers to a DTD and the validation was configured to be "on", the parser validates against the DTD. If the XML document refers to a schema, the factory also needs some other features/properties (as in "SAX features" and "SAX properties") set in order for the parser to validate against the schema.
Take a look at
this tutorial at IBM DeveloperWorks for details on validating against schemas (with Xerces).