次の形式の xml ドキュメントがあり、xsl テンプレートを使用して変換したいと考えています。
私は xsl 変換の初心者であり、ツリーを再帰する方法を知る必要があるだけですが、問題全体の解決策があればいいのにと思います。
これは xml ドキュメントです。
<?xml version="1.0" encoding="UTF-8" ?>
<nodes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<node>
<type>Parent</type>
<name>.test</name>
<node>
<type>parent</type>
<name>.test.root</name>
<node>
<type>Parent</type>
<name>.test.root.group</name>
<node>
<type>int</type>
<name>.test.root.group.a</name>
<value>0</value>
</node>
<node>
<type>char</type>
<name>.test.root.group.b</name>
<value>-</value>
</node>
</node>
</node>
<node>
<type>parent</type>
<name>.test.versions</name>
<node>
<type>utf-8</type>
<name>.test.versions.version</name>
<value>alpha</value>
</node>
<node>
<type>utf-8</type>
<name>.test.version.extra</name>
<value>16.5</value>
</node>
</node>
</node>
</nodes>
そして、これは私が生成されたhtmlを次のようにしたい方法です:
--------------------------------------------------。 | | ツリー | 値 | タイプ | |------------------------+-----------+--------| | | '- テスト | | | 親| | | |- ルート | | | 親| | | | | '- グループ | | | 親| | | | | |-a | 0 | 整数 | | | | | '-b | - | チャー | | | '- バージョン | | | 親| | | |- バージョン | "アルファ" | utf-8 | | | '-余分な| 16.5 | utf-8 | '-------------------------------------------------'