simpleXMLelement wrapping a few node in a parent node

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Snaggy

    #1

    simpleXMLelement wrapping a few node in a parent node

    I have this structure:

    <node>
    <subnode />
    <subnode />
    <subnode />
    <subnode />
    </node>

    I want to get this:

    <node>
    <wrapper>
    <subnode />
    <subnode />
    <subnode />
    <subnode />
    <wrapper>
    </node>

    How to do it with simpleXMLelemen t in php 5?

    bye
    thanks

    Luca

  • Andy Hassall

    #2
    Re: simpleXMLelemen t wrapping a few node in a parent node

    On 13 Dec 2006 12:33:03 -0800, "Snaggy" <l.cioria@gmail .comwrote:
    >I have this structure:
    >
    ><node>
    <subnode />
    <subnode />
    <subnode />
    <subnode />
    ></node>
    >
    >I want to get this:
    >
    ><node>
    <wrapper>
    <subnode />
    <subnode />
    <subnode />
    <subnode />
    <wrapper>
    ></node>
    >
    >How to do it with simpleXMLelemen t in php 5?
    From the looks of the API, you probably want to use the facility to convert to
    and from the DOM API, which would let you do this easily enough.

    --
    Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    Working...