0

BeanIO のテンプレート セクションを読んでいますが、テンプレートを含む外部ファイルに固有のものは見つかりませんでした。基本的に、すべてのテンプレートを保持し、他のファイルから特定のテンプレートを参照する xml ファイルを作成しようとしています。

このファイル mytemplates.xml があります

<beanio>

    <template name="theTemplate">
        //template fields
    </template>
</beanio>

myfile.xml という別のファイルがあり、mytemplates.xml のテンプレートを使用します。

<beanio>
    <stream name="aaa" format="fixedlength">
            <include template="theTemplate"/>
    </stream>
</beanio>

これを達成する方法はありますか?

4

1 に答える 1

1

今後の参考のために、レポをナビゲートする答えを見つけ、誰かが beanIO グループでも言及しました。それが役に立てば幸い。

<beanio xmlns="http://www.beanio.org/2012/03" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.beanio.org/2012/03 http://www.beanio.org/2012/03/mapping.xsd">



<--I had to go up to package level to make it work ie: org/app/myapp/mytemplates.xml-->
  <import resource="classpath:mytemplates.xml"/>

  <!-- the rest of your file -->
</beanio>
于 2016-05-25T13:18:50.720 に答える