On 10/11/12 16:50, Ramon F Herrera wrote:
> I have tried with some automated file-validation tool, but concluded
> that their approach was fundamentally flawed: You cannot possibly
> generate an schema based on only one XML sample.
No, you can generate a schema that describes that single document. This
has been known for a long time, at least since the days of OCLC's Fred
(using SGML DTDs). If the document is sufficiently representative of its
type, it is a good starting-point for manual refinement, and saves a lot
of time on those (rare) occasions when it is necessary.
> Not unlike electoral polls (or any kind of sampling), the more
> samples you have, the more accurate the result. Yes, I know that at
> some point you reach diminishing returns.
For it to be useful, the samples must describe the same type of
document. Creating the union of TEI and DocBook is probably not useful :-)
> Are you folks aware of any such tool? One that takes a whole bunch
> (I have an infinite numbers, can make a widely varied set) of XML
> files and creates their best-fit schema?
If you can infer a sample fragmentary grammar and express it in a
generalised machine-readable syntax, then you can probably deduce the
union of multiple instances of other fragments of the same grammar,
provided they possess sufficient commonality.
> ps: There's a business opportunity...
Limited, I would say, but certainly there.
///Peter