You are here: Re: xml beginner - hierarchies « PHP Programming Language « IT news, forums, messages
Re: xml beginner - hierarchies

Posted by strawberry on 11/27/06 16:19

laptopalias wrote:

<SNIP>
What's the simplest way to produce an array like the one at bottom from
a snippet of xml like that provided below?

<tables>
<table1 id="0">
<table1 id="9">
<table2 id="10"/>
<table2 id="12"/>
</table1>
<table1 id="10">
<table2 id="17"/>
</table1>
<table1 id="17">
<table2 id="1"/>
</table1>
<table1 id="22"/>
</table1>
<table1 id="11">
<table1 id="12">
<table2 id="13"/>
<table2 id="14"/>
</table1>
<table1 id="13"/>
<table1 id="21"/>
<table1 id="14"/>
</table1>
</tables>

(table, id, parent)
table1,0,null
table1,9,0
table2,10,9
table2,12,9
table1,10,0
table2,17,10
table1,17,0
table2,1,17
table1,22,0
table1,11,null
table1,12,11
table2,13,12
table2,14,12
table1,13,11
table1,21,11
table1,14,11
</SNIP>

Hmm, perhaps it's not nearly as straightforward as I thought :-(

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация