I´m trying to get all restrictions (minOccurs, maxOccurs, totalDigits, maxLength etc.) for elements, simpleTypes and complexTypes in an XML schema file. Since these restrictions are in child elements, it should be possible to select these restriction elements per xsd:element, xsd:simpleType and xsd:complexType, along with the value of the attribute "name". I can then loop through the result set element-by-element and fill a table with the restrictions for each element.
Unfortunately, I´m not able to build such an XPath expression. Maybe it isn´t even possible? This is what i have so far:
//*[xsd:element[@name] or xsd:simpleType[@name] or xsd:complexType[@name]]//xsd:restriction/descendant::*
This gets me the restrictions, like minOccurs etc., but I need to have the parent elements with their @name-value.