Hi All,
I have schema type bellow and XJC gives me errors that element
"definePosition" is definded in more than one property. I have tried to
rename properties via:
<bindings schemaLocation="wd-fpml-4-3-2007-05-14/xml/fpml-
reconciliation-4-3.xsd"
node="//xsd:complexType[@name='PositionsAsserted']">
<bindings
node=".//xsd:complexContent/xsd:extension/xsd:sequence/xsd:choice">
<bindings
node=".//xsd:sequence/xsd:element[@name='definePosition']">
<property name="NewPosition"/>
</bindings>
<bindings
node=".//xsd:choice/xsd:element[@name='definePosition']">
<property name="UpdatedOrNewPosition"/>
</bindings>
</bindings>
</bindings>
But no luck and I got following error:
[INFO] Removed old generateDirectory
'C:\Personal\Projects\vivat\poc\vivat-poc-domain\target\generated-sources\xjc'.
[ERROR] XJC while parsing schema(s)
file:/C:/Personal/Projects/vivat/poc/vivat-poc-domain/src/main/xsd/fpml.xml[25,45]:
com.sun.is
tack.SAXParseException2: compiler was unable to honor this property
customization. It is attached to a wrong place, or its inconsi
stent with other bindings.
[ERROR] XJC while parsing schema(s)
file:/C:/Personal/Projects/vivat/poc/vivat-poc-domain/src/main/xsd/wd-fpml-4-3-2007-05-14/xml/
fpml-reconciliation-4-3.xsd[500,72]: com.sun.istack.SAXParseException2: (the
above customization is attached to the following loca
tion in the schema)
[ERROR] XJC while parsing schema(s)
file:/C:/Personal/Projects/vivat/poc/vivat-poc-domain/src/main/xsd/wd-fpml-4-3-2007-05-14/xml/
fpml-reconciliation-4-3.xsd[499,61]: com.sun.istack.SAXParseException2:
Element "{
http://www.fpml.org/2007/FpML-4-3}definePosition
" shows up in more than one properties.
[ERROR] XJC while parsing schema(s)
file:/C:/Personal/Projects/vivat/poc/vivat-poc-domain/src/main/xsd/wd-fpml-4-3-2007-05-14/xml/
fpml-reconciliation-4-3.xsd[493,94]: com.sun.istack.SAXParseException2: The
following location is relevant to the above error
FPML fpml-reconciliation-4-3.xsd schema type:
<xsd:complexType name="PositionsAsserted">
<xsd:annotation>
<xsd:documentation xml:lang="en">Request that a portfolio be defined,
either by replacing any pre-existing definition, or by updating or removing
individual positions.</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="RequestMessage">
<xsd:sequence>
<xsd:element name="portfolio" type="InitialPortfolioDefinition">
<xsd:annotation>
<xsd:documentation xml:lang="en">Contains the portfolio
definition.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="submissionsComplete" type="xsd:boolean">
<xsd:annotation>
<xsd:documentation xml:lang="en">Indicates whether all
portfolio updates have been submitted for this as-of
date</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:choice>
<xsd:annotation>
<xsd:documentation xml:lang="en">Either start from scratch and
define new positions, or just update and remove
positions</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="replaceAllPositions" type="Empty">
<xsd:annotation>
<xsd:documentation xml:lang="en">Indicates that this
message replaces all previous positions for this
portfolio.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="definePosition" type="DefinePosition"
maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation xml:lang="en">Used to specify a new
position.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="definePosition" type="DefinePosition">
<xsd:annotation>
<xsd:documentation xml:lang="en">Used to specify a
position, whether it is a new or updated position.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="removePosition" type="PositionReference">
<xsd:annotation>
<xsd:documentation xml:lang="en">Used to remove a position
from the portfolio.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:choice>
</xsd:choice>
<xsd:element name="party" type="Party" minOccurs="2"
maxOccurs="unbounded" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Giedrius