rupam baruah
rupam baruah

Reputation: 11

How to configure DITA DTD to VS Code?

I want to see DITA validations working for my file. How do I implement a DTD? for example,

Upvotes: 1

Views: 249

Answers (1)

Chris Lindgren
Chris Lindgren

Reputation: 607

Hopefully this solution helps, as I just implemented it for myself:

  1. Install RedHat's vscode-xml extension.
  2. Add the following key-value pairs to your VS Code settings.json file:
// XML SETTINGS
"xml.catalogs": ["file:///path/to/your/dita-ot-x.x.x/catalog-dita.xml"],
"xml.server.vmargs": "-Djdk.xml.entityExpansionLimit=128000",
"xml.validation.enabled": true,
"xml.validation.resolveExternalEntities": true,
"xml.format.splitAttributes": "splitNewLine",
"xml.format.splitAttributesIndentSize": 2,
"xml.completion.autoCloseTags": true,
"[xml]": {
  "editor.defaultFormatter": "redhat.vscode-xml",
  "editor.tabSize": 2,
  "editor.autoIndent": "advanced",
  "editor.guides.indentation": true,
  "editor.linkedEditing": true,
},

NOTES:

  • xml.catalogs: You need to change the path value for xml.catalogs, so it points to the DITA XML catalog within the Open Toolkit on your local computer.
  • xml.server.vmargs: This keyed setting changes the default validation size limit to something more reasonable, but you can modify it to your needs.
  • Many of the other keyed settings and their values are customizable and specific to my preferences. Change as desired.

Upvotes: 0

Related Questions