यह XSD भाग से प्राप्त हुई थी: http://www.iana.org/assignments/xml-registry/schema/netconf.xsdXSD प्रारूपण <element><complexType> बनाम <complexType /><element/>
<xs:complexType name="rpcType">
<xs:sequence>
<xs:element ref="rpcOperation"/>
</xs:sequence>
<xs:attribute name="message-id" type="messageIdType" use="required"/>
<xs:anyAttribute processContents="lax"/>
</xs:complexType>
<xs:element name="rpc" type="rpcType"/>
और कोर NETCONF एक XML दस्तावेज के नोड होने में कॉल कार्य करने के लिए है। मैं के रूप में उत्सुक हूँ कारण है कि यह कुछ ऐसा नहीं है:
[com.sun.istack.SAXException2: unable to marshal type "netconf.RpcType" as an element because it is missing an @XmlRootElement annotation]
मेरे पास है:
<xs:element name="rpcType">
<xs:complexType>
<xs:sequence>
<xs:element ref="rpcOperation"/>
</xs:sequence>
<xs:attribute name="message-id" type="messageIdType" use="required"/>
<xs:anyAttribute processContents="lax"/>
</xs:complexType>
</xs:element>
तर्क है कि # 1 में जब मार्शल करने के लिए एक सेम (jaxb2 में) की कोशिश कर रहा मैं अपवाद है this लेख बार-बार पढ़ रहा है, और वास्तव में अंतर को पकड़ नहीं सकता है, और यह # 1 बनाम # 2 क्यों होगा ...
यदि 'सरल बाध्यकारी मोड' का उपयोग करते समय, xsd को विस्तारित या संयुक्त किया जाता है, और एक अन्य रूट तत्व को उसी प्रकार (एक्सटेंशन में) के साथ परिभाषित किया जाता है, तो एक एक्सजेसी संकलन समय त्रुटि होगी, या रनटाइम त्रुटि या अनिश्चित व्यवहार ? – Vihung