org.w3c.dom.Document
from a resource name. One can create
validating documents (those defined via a DTD and are well formed) or those that
are well formed but not necessarily defined via a DTD.
Useage: To retrieve a document factory perform the following:
final DocumentFactoryIfc documentFactory = DocumentFactory.getSingleton ();To create a valid document (meaning defined via a DTD) whose XML is defined via the resource name
foo.xml
, perform the following:
final Document document = documentFactory.createValidatingDocument ( "foo.xml" );To create a document whose contents are simply well-formed and whose XML is defined via
bar.txt
, perform the following:
final Document document = documentFactory.createDocuemtn ( "bar.xml" );Please note: If the resource name presented cannot be found, both create methods will return
null
.
Also note: In resolving system resources, DocumentFactory
uses DTDEntityResolver
to find resources via the class
org.jplate.util.resource.ResourceMgr
.
@see org.w3c.dom.Document
@see org.jplate.util.resourcemgr