我正在使用Apache的Xerces2-j解析我的XSD。我试图获取XSD中元素/属性声明的数据类型信息。
以下是一个XSD示例:
<xs:element name="Pretzel">
...
<xs:attribute name="Flavor" type="xs:string"/>
<xs:attribute name="ProductID" type="xs:nonNegativeInteger"/>
...
</xs:element>
在这种情况下,我想获取Flavor和ProductID属性的数据类型。根据W3C Schema API和其Xerces2-j实现,XSAttributeDeclaration的getActualVCType()将提供所需内容。但是对我来说,该方法总是返回45,即UNAVAILABLE_DT。这是Xerces2-j中的一个错误,还是我对API的理解有误?如果是后者,我希望有人能指点我正确方向。