0
复杂类型的包装我有以下的XSD架构中定义的XPath对元素
<xs:element name="MainType">
<xs:complexType>
<xs:sequence>
<xs:element name="InnerType">
<xs:complexType>
<xs:sequence>
<xs:element ref="OtherType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
我想写OTHERTYPE绑定元素,但我有使用XPath问题。我写了这个XPath的地址为OtherType。
//xs:element[@name='MainType']//xs:complexType//xs:element[@name='InnerType']//xs:complexType//xs:element[@name='OtherType']
我试着跳过XPath中元素之间的complexType,但它也不起作用。 JAXB插件返回此错误
om.sun.istack.SAXParseException2: XPath evaluation of ... results in empty target node
你正在寻找最里面的属性是'@ REF ='OtherType''不@name? – StuartLC
谢谢,我没有注意到这个错误。 – misco
这是否回答这个问题,即我们可以关闭一个小错字? – StuartLC