XML Grouping


Posted on 16th Feb 2014 07:03 pm by admin

I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, here's the XML

<categories>
<category id="12345">
<title>category title 1</title>
<tips>
<tip id="0">
<title>hello world</title>
<content>some content</content>
</tip>
<tip id="1">
<title>foo</title>
<content>foo content</content>
</tip>
</tips>
</category>
<category id="7890">
<title> category title 2</title>
<tips>
<tip id="2">
<title>another tip title</title>
<content>blah blah</content>
</tip>
<tip id="3">
<title>another tip title</title>
<content>blah blah</content>
</tip>

</tips>
</category>
</categories>


How would I just grab the tip titles for the 2nd category (7890)? Hope I'm making sense.
I can loop through the array using foreach, but have no way to determine if a tip belongs to the 1st or 2nd category. Ideas??

Please help!

Thanks

No comments posted yet

Your Answer:

Login to answer
170 Like 5 Dislike
Previous forums Next forums
Other forums

how to get sn motherboard
Hello.
I want to get serial number motherboard, cpu and else hardware.
Can You show me sam

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

TimeZoneOffset
Hello,

Please i need your help. I have a system that users can use to punch in and out. This

Captcha problem users just refresh and it will let them auto submit again
Users will just re submit and not have to enter the new captcha.. ? Lol but if i refresh the page, t

please help me in this update statment
hi every one

if I have table and this data in it

id name
10

Oracle Connectivity
Hi Every One,

Can we access SAP from oracle database.If it possible then please spec

Getting number of affected rows in SQLPLUS..
Hi everyone,
I have a shell script where i am invoking sqlplus, running a query and saving t

Insert numbers from Barcode scanner into online php page
I have a real big problem, Here is what I'm trying to do. I have a Intermec CN3 handheld computer th

Create multiple (n) arrays
Hi there,

I have the following need:

I have 2 arrays (coming from a databases)

Function module "DPS_CHECK_TABLE_EXISTS" not found (after OSS 1422843 impl)
Dear All,

I implemented Note OSS 1422843.

When i execute the new report RSPO20

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash