Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

convert xml to object types

user448703Sep 21 2006 — edited Sep 26 2006
I have xml of the following format coming into pl/sql stored procedure
<ListItems>
<ListItem>
<Field1>f1</Field1>
<Filed2>f2</Field2>
</ListItem>
<ListItem>
<Field1>f1</Field1>
<Filed2>f2</Field2>
</ListItem>
</ListItems>

I would like to convert this xml to object types so that I can refer to the data something like this objectName.fieldName and objectName(index).fieldName.
I was able to achieve objectName.fieldName through xmltype.toobject method.
I created an object type and used toobject method to load data into that type from xml.

I was not able figure out how to load object types when we have lists. I even tried registering a schema and loading data into the types created by oracle. I was able to load data but unable to access data like objectName(index).fieldName.

How can I convert xml that has list of items into an object type so that I can access elements from an array of object type.

thanks for the help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 24 2006
Added on Sep 21 2006
7 comments
1,809 views