<xs:attributeGroup name="arcAttrs"> <xs:attribute ref="xlink:type" use="required" fixed="arc"/> <xs:attribute ref="xlink:arcrole"/> <xs:attribute ref="xlink:title"/> <xs:attribute ref="xlink:show"/> <xs:attribute ref="xlink:actuate"/> <xs:attribute ref="xlink:from"/> <xs:attribute ref="xlink:to"> <xs:annotation> <xs:documentation> from and to have default behavior when values are missing </xs:documentation> </xs:annotation> </xs:attribute> </xs:attributeGroup> <xs:group name="arcModel"> <xs:sequence> <xs:element ref="xlink:title" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:group> <xs:complexType name="arcType"> <xs:group ref="xlink:arcModel"/> <xs:attributeGroup ref="xlink:arcAttrs"/> </xs:complexType>
类似于上面这段代码,怎样使用XPath获得<xs:attribute ref="xlink:title"/> 或<xs:element ref="xlink:title" minOccurs="0" maxOccurs="unbounded"/>
?
做这个是想要使用java类的xjc将xsd直接生成为java包,但这里有两个xlink:title 出现明明冲突的问题,因此想通过xjb文件来重新定义title名称,but一直取不到这两个节点,求高手相助
ref 对应的是另外一个具体的xml节点元素。重新的根据这个ref值找到对于的节点,然后替换到ref的节点应该就可以了吧。