Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to derive DTD (or other XML spec format) from XML file samples

Tags:

xml

dtd

Do you know of a tool that will derive a DTD (or other XML structure specification format) from a sample set of XML files?

Currently the only (automatic) validation we have for an xml encoded DSL is a legacy parser written in Perl, but for consistency reasons all perl code must be ported to C-sharp.

like image 649
lexu Avatar asked Nov 29 '09 10:11

lexu


2 Answers

Here is the program that worked for me DTDGenerator. You need to compile it with Java, but it works well. I am surprised by the lack of free software for a language that has been around for a long time, but this one is free under Mozilla Public License Version 1.0.

like image 180
Forethinker Avatar answered Sep 19 '22 19:09

Forethinker


You can use xsd.exe (part of visual studio) to generate an XML schema for a given XML file.

like image 21
Vinz Avatar answered Sep 21 '22 19:09

Vinz