1
我已生成的Java類後失蹤,我想從JAXB類編組的前綴命名空間JAXB命名空間從XSD編組
這裏是我有
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.org/event"
xmlns:tns="http://www.example.org/event"
elementFormDefault="qualified">
<element name="Events" type="tns:EventsType"></element>
<complexType name="EventsType">
<sequence>
<element name="Event" type="tns:inputFlowEventType" maxOccurs="unbounded" minOccurs="1"></element>
</sequence></complexType>
<complexType name="inputFlowEventType">
<sequence>
<element name="DISTRIBUTOR_ID" minOccurs="1" maxOccurs="1">
<simpleType><restriction base="string"><maxLength value="17"></maxLength></restriction></simpleType>
</element>
</sequence>
</complexType>
</schema>
和我有這個
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Events xmlns="http://www.example.org/event"><Event><DISTRIBUTOR_ID>6</DISTRIBUTOR_ID></Event></Events>
,而不是這個
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <tns:Events xmlns="http://www.example.org/event"> <tns:Event><tns:DISTRIBUTOR_ID>6</tns:DISTRIBUTOR_ID></tns:Event></tns:Events>
有人知道什麼是錯的嗎?
謝謝
首先,你必須在最後一節,你應該期待,而一個錯字(注意的xmlns:TNS = '''部分): <?xml version =「1.0」encoding =「UTF-8」standalone =「yes」?> 6 tns:DISTRIBUTOR_ID> –