NotMyRealName221
Programmer
I'm consuming some XML from a sevice that I have no control over. The XML is comming back something like this:
ok, that should be enough XML...
I need to be able to output the data like this:
Project 1
task 1 Finish this task quickly
task 2 Finish this task more quickly
task 4 Finish this task first
Project 2
task 3 Finish this task slowly
I'm not sure how to relate the id in the project node to the projectId in the task node.
Thanks for any help
Code:
<root>
<projects>
<project>
<id>1</id>
<name>Project 1</name>
</project>
<project>
<id>2</id>
<name>Project 2</name>
</project>
</projects>
<tasks>
<task>
<projectId>1</projectId>
<name>task 1</name>
<notes>Finish this task quickly</notes>
</task>
<task>
<projectId>1</projectId>
<name>task 2</name>
<notes>Finish this task more quickly</notes>
</task>
<task>
<projectId>2</projectId>
<name>task 3</name>
<notes>Finish this task slowly</notes>
</task>
<task>
<projectId>1</projectId>
<name>task 4</name>
<notes>Finish this task first</notes>
</task>
</tasks>
</root>
I need to be able to output the data like this:
Project 1
task 1 Finish this task quickly
task 2 Finish this task more quickly
task 4 Finish this task first
Project 2
task 3 Finish this task slowly
I'm not sure how to relate the id in the project node to the projectId in the task node.
Thanks for any help