tags:

views:

36

answers:

1

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...

+2  A: 

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.

Gordon