XML_Serializer and creating multi-level XML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



How can you use  XML_Serializer to generate XML with multiple levels ?

XML_Serializer seems really useful for  single level XML docs like:
<parent>
	<child/>
	<child/>
	<child/>
</parent

How can I get XML_Serializer to do something like the below ?
<parent>
	<child>
		<child/>
		<child>
			<child/>
			<child/>
		</child>
	</child>
</parent>
	

Or, is there something pre-existing that is better than XML_Serializer for multi-level XML ? I have built my own function to do this, but it is quite ugly and not as easy to reuse as I would like.
many thanks


My own query result looks similar to:
playlist_id, media_id
1                , 1
1                , 2
1                , 3
2                , 1
2                , 5
3                , 10


And this is what I need XML_Serializer to generate:
<query>
<playlists>
<playlist>
<meta><id>1</id></meta>
<content>
<spot><id>1</id></spot>
<spot><id>2</id></spot>
<spot><id>3</id></spot>
</content>
</playlist>
<playlist>
<meta><id>2</id></meta>
<content>
<spot><id>1</id></spot>
<spot><id>5</id></spot>
</content>
</playlist>
<playlist>
<meta><id>3</id></meta>
<content>
<spot><id>10</id></spot>
</content>
</playlist>
</playlists>
</query>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux