Çocuk düğümleri içine tüm düğümün nitelikleri dönüştürmek

0 Cevap php

is there a way to convert all nodes' attributes into child Nodes using XSLT 1.0 ? It must run flawlessly with PHP's xsltProcessor. The attributes must be removed (if possible).

Örnek giriş:

<root aaa="111" bbb="222" ccc="333">
    <bob ddd="444" />

    <data eee="555">
        <steve>bar1</steve>
        <john>bar2</john>
        <peter fff="666">bar3</peter>
    </data>

    <greg ggg="777" />
</root>

Arzu edilen sonuç:

<root>
    <aaa>111</aaa>
    <bbb>222</bbb>
    <ccc>333</ccc>
    <bob>
        <ddd>444</ddd>
    </bob>
    <data>
        <eee>555</eee>
        <steve>bar1</steve>
        <john>bar2</john>
        <peter>
            <fff>666</fff>
            bar3
        </peter>
    </data>
    <greg>
        <ggg>777</ggg>
    </greg>
</root>

Teşekkür ederiz!

0 Cevap