CDA xml ドキュメントの生成に使用される大きな CDA スキーマ ファイルがあります。コードのコンパイル中に xds スキーマを使用して POJO クラスを生成したいと考えています。以下のように jaxb2-maven-plugin でこれをやろうとしています:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>myDirectoryName</schemaDirectory>
<schemaFiles>myxsdFile</schemaFiles>
</configuration>
</plugin>
これは単純な xsd ファイルで動作するようです。しかし、私のCDAではエラーがスローされます
ゴール org.codehaus.mojo:jaxb2-maven-plugin:1.6:xjc の実行に失敗しました。. 同じフィールドを 2 回作成しようとしています: id
id が要素と属性の両方として存在するため、問題を引き起こしている xsd の部分は次のとおりです。
<xs:complexType name="POCD_MT000040.ObservationMedia">
<xs:sequence>
<xs:element name="realmCode" type="CS" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="typeId" type="POCD_MT000040.InfrastructureRoot.typeId" minOccurs="0" />
<xs:element name="templateId" type="II" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="id" type="II" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="languageCode" type="CS" minOccurs="0" />
<xs:element name="value" type="ED" />
<xs:element name="subject" type="POCD_MT000040.Subject" minOccurs="0" />
<xs:element name="specimen" type="POCD_MT000040.Specimen" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="performer" type="POCD_MT000040.Performer2" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="author" type="POCD_MT000040.Author" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="informant" type="POCD_MT000040.Informant12" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="participant" type="POCD_MT000040.Participant2" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="entryRelationship" type="POCD_MT000040.EntryRelationship" minOccurs="0"
maxOccurs="unbounded" />
<xs:element name="reference" type="POCD_MT000040.Reference" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="precondition" type="POCD_MT000040.Precondition" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="ID" type="xs:ID" />
<xs:attribute name="nullFlavor" type="NullFlavor" use="optional" />
<xs:attribute name="classCode" type="ActClassObservation" use="required" />
<xs:attribute name="moodCode" type="ActMood" use="required" />
</xs:complexType>
これに対する解決策は、これまでのところ見つけることができました ( http://metro.1045641.n5.nabble.com/troubleshoot-quot-trying-to-create-the-same-field-twice-quot-error-td1059643. html ) xds に変更を加えることを提案しますが、これは私にとっては選択肢ではありません。xds を変更するか、他のユーティリティを使用する以外に方法はありますか?