PHP deepening XML structure

unushFa

New Member
given the following XML structure (i have this in an XML-file, with lots of other content - the \[code\]<p>\[/code\] tags are just there to indicate that other tags may follow):\[code\]<TITEL1>...</TITEL1> <p>..</p><TITEL2>...</TITEL2> <TITEL3>...</TITEL3><TITEL3>...</TITEL3> <P>...<P> \[/code\]is there a way to get to this using PHP (write it to a new file):\[code\]<TITEL1> <TITEL>...</TITEL> <p>...</p> <TITEL2> <TITEL>...</TITEL> <TITEL3> <TITEL>...</TITEL> <P>...</P> </TITEL3> <TITEL3> <TITEL>...</TITEL> <P>...</P> </TITEL3> </TITEL2></TITEL1>\[/code\]or in other words,is there a way to have higher level titels inclose lower level titels and all content that follows them, thus creating a nested structure. The content of each TITEL1,2 and 3 tag should go into a new \[code\]<TITEL>\[/code\]-elementI already asked the same question on the XSLT-side of the forum but got the advise to try with c# or java. Since I don't know those languages and know somewhat more than the basics of PHP i thought of trying it that way. Can anyone set me on my way?
 
Back
Top