Home » Developer & Programmer » JDeveloper, Java & XML » How to get count of a repetating element in xml -tricky -need Help
How to get count of a repetating element in xml -tricky -need Help [message #352820] Thu, 09 October 2008 14:55 Go to next message
kanis
Messages: 61
Registered: November 2006
Member

I have a xml like as below

<root>
<a>
<b>
<c1> apple1</c1>
<c1> banna</c1>
<c1> apple2</c1>
<c1> apple2</c1>
<c1> apple2</c1>
</b>
<b>
<c1> apple1</c1>
<c1> banna</c1>
<c1> apple2</c1>
</b>
</a>
<a>
<b>
<c1> banna</c1>
<c1> apple2</c1>
</b>
</a>
</root>



how i can write code in pl/sql where my out put will be
like as below
---------------------
under 1st block of a
In 1st block of b ----c1 is repeted 5 times.

In 2nd block of b ----c1 is repeted 3 times.

under 2nd block of a
In 1st block of b ----c1 is repeted 2 times.

-------------------
my input will be xpath //root/a/b/c1.

Please help me . I need it urgently .....


Thanks in advance for your help .




Re: How to get count of a repetating element in xml -tricky -need Help [message #352854 is a reply to message #352820] Thu, 09 October 2008 22:55 Go to previous message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Post a test case: create table and insert statements along with the result you want with these data.

Before please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Regards
Michel
Previous Topic: how to get connection from dedicated server?
Next Topic: Problem during loadjava execution
Goto Forum:
  


Current Time: Sun Nov 24 00:35:57 CST 2024