문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top