Fran
Fran

Reputation: 11

Need single XSD for multiple large XML files

My question is about creating one XSD (XML Schema file) from various similar, but not identical, XML files. Please note, the files do not contain their own XSD's. I first have to determine every file's schema. Then I want to create a single schema catering for all variations. This single schema will then be used as a nested file format in SAP DS in order to load all data into one table.

I also need a proper tool to do the conversion from XML to XSD if anyone is aware of a good (free) tool I would be very grateful.

Upvotes: 1

Views: 847

Answers (1)

kjhughes
kjhughes

Reputation: 111726

An XML file obviously underspecifies an XSD. Multiple XML files reduce the space but still necessarily underspecify the set of XSDs that could be used to validate the XML files.

Since tool recommendations are off-topic on Stack Overflow, here's a generic approach recommendation instead:

  1. Create an XSD from the first XML document. Initially, you can do this manually or automatically to jump-start the process.

  2. For each XML document, attempt validation against the current XSD.

    2.1. Repair validation errors by updating the XSD.

    2.2. Continue until no validation errors remain.

Upvotes: 2

Related Questions