-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Labels
Description
Hello,
Are there any functions that can detect the type of document I pass into "readXMLDOM" and automatically set the schema (e.g., invoice, catalogue)? Currently, I have to manually specify the document type before reading it (e.g., UBL21Marshaller.catalogue()).
// Read
final Document aDoc = DOMReader.readXMLDOM (new ClassPathResource (sFilename),
new DOMReaderSettings ().setSchema (UBL21Marshaller.catalogue ().getSchema ()));
assertNotNull (sFilename, aDoc);
final CatalogueType aUBLObject = UBL21Marshaller.catalogue ().read (aDoc);
assertNotNull (sFilename, aUBLObject);
// Validate
IErrorList aErrors = UBL21Marshaller.catalogue ().validate (aUBLObject);