2
考慮以下XSD文件:XSD與下劃線的Java在XSD文件
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Customer_Info" type="Customer"/>
<xsd:complexType name="Customer_Info">
<xsd:all>
<xsd:element name="Profile" type="Profile" minOccurs="1" maxOccurs="1"/>
<xsd:element name="Address" type="integer" minOccurs="1" maxOccurs="1"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="Profile">
<xsd:all>
<xsd:element name="Name" minOccurs="1">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Email" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Phone" maxOccurs="1">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="12"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="Address">
<xsd:all>
<xsd:element name="FlatNo" minOccurs="1">
<xsd:simpleType>
<xsd:restriction base="xsd:integer">
<xsd:maxLength value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Street" minOccurs="1">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Landmark" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:schema>
正如你可以在此看到我有「_」在CUSTOMER_INFO複雜類型。現在,當我使用JAXB的xjc命令生成Java文件時,我將文件名命名爲CustomerInfo.java。 另外我想在我生成的Java文件中使用flatNo作爲字符串的類型
....但我希望獲取文件名作爲Customer_Info.java。誰可以幫我這個事?在此先感謝...
你能幫助我解決一個問題嗎? –