-2

I'm trying to convert some HTML files to XML format on ubuntu and they should conform to a specific XML schema or DTD. I guess Tidy should do that but I don't understand the syntax for it. Or if there are other tools, I'd be glad to try them out. For instance: Convert file.htm to file.xml (which conforms to standard.DTD) Thanks

TheSoldier
  • 484
  • 1
  • 5
  • 25

1 Answers1

1

Tidy can convert HTML to XHTML (the same structure of elements and attributes but meeting the rules for XML well-formedness), but it can't convert it to meet the requirements of some arbitrary DTD.

You'll need to write an explicit mapping between the two data formats for that. XSLT is a popular language for doing that.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • If I have an XSLT script. Can you suggest any programs that I could use for the transformation? I guess Visual Studio can do this, but I've tried unsuccessfuly to understand it and I'm kind of limited by time. Thanks – TheSoldier Aug 17 '17 at 10:34