PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have a XML which can have n number of nested categories and subcategories. The problem is node names are all same for each level. Now can any please tell how can I display names with relation between each?
Or how will loop work or any other method of getting values?
I mean display should be:
Category 1
- Subcategory
- More Subcategory
Category 2
- Subcategory
- More Subcategory
and so on....
The XML I am having is something like this:
[syntax="xml"]
<taxonomy>
<form id="96451" name="Cars">
<taxonomy>
<form id="96477" name="Auto Parts and Accessories"></form>
<form id="96621" name="Automotive Security Systems"></form>
<form id="96478" name="Motorcycle Parts and Accessories"></form>
<form id="96456" name="New Cars">
<form id="96457" name="Used Cars"></form>
</taxonomy>
</form>
<form id="2010" name="Clothing and Accessories">
<taxonomy>
<form id="31515" name="Clothing"></form>
<form id="68185" name="Luggage"></form>
<form id="96602" name="Shoes"></form>
</taxonomy>
</form>
</taxonomy>
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
seopower wrote:I am novice in php and will Greatly appriciate ..... If any one can provide some code examples for DOM or simple xml.
Since I already gave you a working example of xsl(t) and as superdezign mentioned the documentation provides a lot of examples your statement -sorry to say so- translates to "I don't want to learn that stuff, please code my script" for me.
You cannot expect to accomplish a complex task in "no time" when you're new/unexperienced in all techniques involved.
Last edited by volka on Mon Jul 09, 2007 7:54 am, edited 1 time in total.
Just for the record: There's nothing wrong with beeing new/unexperienced, we all were at some point. But then you have to allow yourself the time to learn or the money to hire someone if the pressure is already on.
volka wrote:Just for the record: There's nothing wrong with beeing new/unexperienced, we all were at some point. But then you have to allow yourself the time to learn or the money to hire someone if the pressure is already on.
... And put forth a decent effort. The first step to failure is to not try.