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: 59293
Registered: March 2007
Location: Nanterre, France, http://...
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: Thu Oct 02 04:45:25 CDT 2014

Total time taken to generate the page: 0.21229 seconds