mimrock
mimrock

Reputation: 4883

Validate DITA in php

What php library should I use if I want to get the allowable attributes in a tag, or the allowable tags in a specific part of a DITA XML document, according to it's DTD or XSD?

I've tried it with the XML_DTD-0.5.2 pear lib, but it seems it parses the offical 1.1 and 1.2 DITA dtds with many errors...

Upvotes: 1

Views: 374

Answers (1)

Gordon
Gordon

Reputation: 317147

Use DOM or XMLReader and then use their respective methods to validate XML against a schema:

Or simply load the Schema directly with these libraries. Since Schema is XML too you can process it like any other XML, e.g. find out what attributes are defined for an element.

Upvotes: 2

Related Questions