John Cornellier
John Cornellier

Reputation: 105

Converting HTML to DITA with h2d.xsl

Used tidy to convert some HTML to XML and now want to use it with DITA-OT. I ran h2d.xsl via Oxygen on it but the output does not validate in DITA. E.g. images wrapped in b tags. I get that h2d.xsl does useful things like adding topic IDs, but I don't get why it creates XML that doesn't validate. Are there parameters or does anyone have a better XSL?

Upvotes: 3

Views: 1875

Answers (1)

Radu Coravu
Radu Coravu

Reputation: 1924

Create in Oxygen a new DITA topic in the Author visual editing mode. Open the HTML content in the web browser, select all, copy and then paste in the topic you created earlier. Oxygen will attempt to convert the HTML content to DITA.

This is also done with special XSLT code developed by Oxygen. The main XSLT for this is located in:

OXYGEN_INSTALL_DIR\frameworks\dita\resources\xhtml2ditaDriver.xsl

and you can also try to create a transformation for it and apply it to the XHTML content.

You can also convert HTML to XHTML by using Oxygen's File->Import->HTML File menu entry.

Upvotes: 4

Related Questions