私はXSLT変換を行っています。私はタグと呼ばれるsometagを持っているソースファイルを持っています。出現順序が指定されていない場合にXSLTの子タグを処理する
私のソースxmlをこのように考えてみましょう。
<ABC>
<Name>Some Name </Name>
<ID>Some ID</ID>
<Address>Some Address</Address>
<Place>Some Place</Place>
<ID>Some ID</ID>
<Name>Some Name </Name>
<Name>Some Name </Name>
</ABC>
ルール:
ABC is parent Tag which has 4 child tags. Name, ID, Address, Place.
These child tags can occur many times and in any ordrer.
Upon reading the tag , I want to change the name of the tag, and do some processing on the value present in the tag.
The input XML may have child tags in any order, and many times.
I want to write a common XSLT which will read the child tags in the order in which they occur, and display them as given under.
私はこのような出力を表示します。
<Frame:Name>
<text>Some Name</text>
</Frame:Name>
<Frame:ID>
<text>Some ID</text>
</Frame:ID>
<Frame:ADdrress>
<text>Some Address</text>
</Frame:Address>
<Frame:Place>
<text>Some Place</text>
</Frame:Place>
<Frame:ID>
<text>Some ID</text>
</Frame:ID>
<Frame:Name>
<text>Some Name</text>
</Frame:Name>
<Frame:Name>
<text>Some Name</text>
</Frame:Name>
私は完全にそれを行う方法に打撃を受けます。
子要素の出現順序がソースXMLで変更される場合は、出力XMLにも反映される必要があります。
レビューを共有できますか?
ありがとうございます。
XSLTコードを共有できますか?それが良いように見える場合は、お客様の要件に応じて変更することができます。新しいコードを設計することはできますが、コードを投稿すると間違いを知ることができます –
希望の結果で最後の 'Name'要素の1つが欠落しています。正してください。 –
修正済み...ありがとうございました – Patan