multi dimensional array search xml parser

Reply

Join Date: Jul 2006
Posts: 15
Reputation: balagod is an unknown quantity at this point 
Solved Threads: 0
balagod balagod is offline Offline
Newbie Poster

multi dimensional array search xml parser

 
0
  #1
Jul 20th, 2006
Hai,
I got xml parser to read xml file the output is like multi dimensional array ,i want to search particular id and get that matched id details from that array if the element have child to read child array also
I give one example here

<map>
<page id="home" name="Home" content="home.xml" template="home.php" bar="home_bar.xml"/>
<page id="training" name="Training" content="training.xml" template="text.php" bar="training_bar.xml">
<page id="training-trainings" name="Trainings" content="training-trainings.xml" template="text.php" bar="training_bar.xml"/>
<page id="training-workshops" name="Workshops" content="training-workshops.xml" template="text.php" bar="training_bar.xml"/>
</page>
</map>

If i give search id ="training"
The out put is the values in
id="training"
name="Training"
content="training.xml"
template="text.php"
bar="training_bar.xml"

2.If i give search id ="home"
The out put is the values in
id="home"
name="Home"
content="home.xml"
template="home.php"
bar="home_bar.xml"

and child nodes values are need
id="training"
name="Training"
content="training.xml"
template="text.php"
bar="training_bar.xml"

2nd child
id="training-trainings"
name="Trainings"
content="training-trainings.xml"
template="text.php"
bar="training_bar.xml"
<page id="training-workshops" name="Workshops" content="training-workshops.xml" template="text.php" bar="training_bar.xml"/>

My Xml parser out put is like this
Array
(
[map] => Array
(
[page] => Array
(
[0] => Array
(
[id] => home
[name] => Home
[content] => home.xml
[template] => home.php
[bar] => home_bar.xml
[value] =>
)

[1] => Array
(
[page] => Array
(
[0] => Array
(
[id] => training-trainings
[name] => Trainings
[content] => training-trainings.xml
[template] => text.php
[bar] => training_bar.xml
[value] =>
)

[1] => Array
(
[id] => training-workshops
[name] => Workshops
[content] => training-workshops.xml
[template] => text.php
[bar] => training_bar.xml
[value] =>
)

)

[id] => training
[name] => Training
[content] => training.xml
[template] => text.php
[bar] => training_bar.xml
[value] =>
)

)

[value] =>
)

)



Any Expert help me

Thanks
Bala
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC