How to reference an attribute in xsd
问题 I tried to define an attribute that could be referenced in subsequent element definitions. <xs:attribute name="ridref" type="xs:string"/> Later I use it like this: <xs:element name="coordRegRef"> <xs:complexType> <!--xs:attribute name="ridref" type="xs:string"/ this works but I want to use ref --> <xs:attribute ref="ridref" use="required"/> </xs:complexType> </xs:element> XSD compiles fine with xmllint xmllint --schema pc-ar.xsd pc-ar.xml But xmllint says pc-ar.xml:41: element coordRegRef: