如何使用 XSOM 解析器从元素中获取 minOccurs 属性?我看过这个例子来获取与复杂类型相关的属性:
private void getAttributes(XSComplexType xsComplexType){
Collection<? extends XSAttributeUse> c = xsComplexType.getAttributeUses();
Iterator<? extends XSAttributeUse> i = c.iterator();while(i.hasNext()){
XSAttributeDecl attributeDecl = i.next().getDecl();
System.out.println("type: "+attributeDecl.getType());
System.out.println("name:"+attributeDecl.getName());
}
}
但是,似乎无法找到将其从元素中移除的正确方法,例如:
<xs:element name="StartDate" type="CommonDateType" minOccurs="0"/>
谢谢!