Eclipse で JAXB を使用してローカライズされた XBRL クラスを生成しようとしていますが、エラーが発生しています。
[ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict.
line 145 of http://www.xbrl.org/2003/xl-2003-12-31.xsd
[ERROR] The following location is relevant to the above error
line 151 of http://www.xbrl.org/2003/xl-2003-12-31.xsd
エラーが示すように、要素と属性名が競合しています。これらは 145 行目と 151 行目です。
<element ref="xl:title" minOccurs="0" maxOccurs="unbounded" />
<attribute ref="xlink:title" use="optional" />
そのため、どちらか (または両方) の名前を変更する必要があります。これは私がやろうとしていたことです - 要素のタイトルを titleElement にバインドします:
<jxb:bindings version="1.0"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xl="http://www.xbrl.org/2003/XLink"
schemaLocation="http://www.xbrl.org/2003/xl-2003-12-31.xsd">
<jxb:bindings node="//element[@ref='xl:title']">
<jxb:property ref="xl:titleElement"/>
</jxb:bindings>
</jxb:bindings>
これにより、次のエラーに加えて、元の「タイトルは既に定義されています」というエラーが生成されます。
[ERROR] XPath evaluation of "//element[@ref='xl:title']" results in empty target node
line 6 of titleElementAttributeFixer.xjb
それを機能させるための提案はありますか?
EDIT:holderdarochaが示唆したように、私の表現は間違っていました。私は XML と XPath に不慣れで、明示的に型指定された「xs:」名前空間が要素にないため、少し混乱しました。そのエラーを修正した後、別のエラーが発生しました。
[ERROR] XPath evaluation of "//xs:element[@ref='xl:title']" results in too many (3) target nodes
すべての「ref」属性を更新する必要があるため、タグ「multiple='true'」をバインディングに入れました。現在、次のエラーが発生しており、解決方法がわかりません。
[ERROR] cvc-complex-type.3.2.2: Attribute 'ref' is not allowed to appear in element 'jxb:property'.
このためのアイデア?問題の要素の属性「ref」の内容を別の名前にバインドしたいと思います。