ジェネリックモデルを使用してバックエンドに送信されるXMLフォームを、システムがXSLTを使用して使用する内部XMLモデルに変換しようとしています。XSLT汎用モデルから特定のモデルへの変換
一般的なモデルは、セクション、行、およびテーブルで構成されています(テーブルは基本的に要素の配列/グループです)。 PKは、tableRowのシーケンスからのものであり、maxPKはカウントです。 MaxPKおそらくそれはXSLTを通して可能かどうかはわからないが、後で入力することができる。
助けていただけたら幸いです!
汎用モデル
<form>
<section>
<name>identification</name>
<sequence>1</sequence>
<line>
<sequence>0</sequence>
<field>
<name>firstName</name>
<value>JOHN</value>
</field>
</line>
<line>
<sequence>1</sequence>
<field>
<name>lastName</name>
<value>DOE</value>
</field>
</line>
</section>
<section>
<name>contactDetails</name>
<sequence>1</sequence>
<line>
<sequence>0</sequence>
<field>
<name>primaryPhone</name>
<value>+44 100 1234</value>
</field>
</line>
<table>
<name>secondaryPhoneGroup</name>
<tableRow>
<sequence>1</sequence>
<field>
<sequence>0</sequence>
<name>secondaryPhone</name>
<value>+44 100 1235</value>
</field>
</tableRow>
<tableRow>
<sequence>2</sequence>
<field>
<sequence>0</sequence>
<name>secondaryPhone</name>
<value>+44 100 1236</value>
</field>
</tableRow>
</table>
</section>
</form>
内部モデル
<form>
<identification>
<firstName>
<asCurrent>JOHN</asCurrent>
</firstName>
<lastName>
<asCurrent>DOE</asCurrent>
</lastName>
</identification>
<contactDetails>
<primaryPhone>
<asCurrent>+44 100 1234</asCurrent>
</primaryPhone>
<secondaryPhoneGroup>
<secondaryPhone>
<pk>1</pk>
<phone>
<asCurrent>+44 100 1235</asCurrent>
</phone>
</secondaryPhone>
<secondaryPhone>
<pk>2</pk>
<phone>
<asCurrent>+44 100 1236</asCurrent>
</phone>
</secondaryPhone>
<maxPK>2</maxPK>
</secondaryPhoneGroup>
</contactDetails>
</form>
ルール、何を試しましたか?例えば、 'pk'と' maxPK'はそれぞれ要素数と位置だけですか? –
あなたの質問の最新情報ではなく、回答を回答として投稿してください。これは混乱を避け、将来の訪問者を助けるためです。削除されたソリューションは、[リビジョン](https://stackoverflow.com/posts/44864560/revisions)にあります。ありがとうございました。 – Bugs