PHP Parse Multi-Lingual XML [closed]

kurruptt

New Member
I have the following Sample XML:\[code\]<?xml version="1.0"?><languages><en> <title>Title</title> <content>Content</content> <header>Header</header> <content>Content</content></en><it> <title>Titolo</title> <box>Testo formato</box> <content>Contenuto</content></it></languages>\[/code\]Basically more languages can be added. The nodes between \[code\]<en>\[/code\] and \[code\]</en>\[/code\], \[code\]<it>\[/code\] and \[code\]</it>\[/code\] can vary.I need to create a PHP script to read a domain, read part of the language of the domain, get the children nodes and replace the node name with html elements.Ex. if the domain is http://domain.com/it/about, I get the following:\[code\]<title>Titolo</title><box>Testo formato</box><content>Contenuto</content>\[/code\]and then output them as the following in the html page:\[code\]<h1>Titolo</h1><div class="box">Testo formato</div><p>Contenuto</p>\[/code\]Anyone got a good tutorial or tips about how to do this?
 
Back
Top