Skip to content

Document type detection #65

@GediminasVaistai

Description

@GediminasVaistai

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);

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions