tranform xmltype contents to expression ?

A

Abhinav

Hi ..

I have the following sort of xml (In an xmlType in the database ..)


<or_group>
<operand>a</operand>
<operand>
<and_group>
<operand>b</operand>
<not_group>
<operand>c</operand>
</not_group>
<and_group>
</operand>
</or_group>

This needs to be evaluated as
a+(b.(!c))

Here, a/b/c are linked to functions which return true/false values, with
the function taking some parameters.

It is possible to do this by creating a linked list out of the tree, and
evaluating in post fix using "native" planguages like C ..

Would like to know if it is possible in PL/SQL .. or is it wishful
thinking ?

Any replies .. even if to say that it isnt possible .. appreciated :)

Regards
Abhinav
 
R

Robert A.M. van Lopik

Abhinav said:
Hi ..

I have the following sort of xml (In an xmlType in the database ..)


<or_group>
<operand>a</operand>
<operand>
<and_group>
<operand>b</operand>
<not_group>
<operand>c</operand>
</not_group>
<and_group>
</operand>
</or_group>

This needs to be evaluated as
a+(b.(!c))

Here, a/b/c are linked to functions which return true/false values, with
the function taking some parameters.

It is possible to do this by creating a linked list out of the tree, and
evaluating in post fix using "native" planguages like C ..

Would like to know if it is possible in PL/SQL .. or is it wishful
thinking ?

Any replies .. even if to say that it isnt possible .. appreciated :)

Regards
Abhinav
well, the PL in PL/SQL stands for Procedural Language. In fact PL/SQL
derives its syntax from ADA. So, if you know how to do it in C, you can do
it in PL/SQL, And yes, there is an XML parser callable from PL/SQL.

hth
rob van lopik
 
A

Abhinav

Robert said:
well, the PL in PL/SQL stands for Procedural Language. In fact PL/SQL
derives its syntax from ADA. So, if you know how to do it in C, you can do
it in PL/SQL, And yes, there is an XML parser callable from PL/SQL.

Thanks..
But are there structural constructs available in pl/sql to do the
transformation? data structures like B-Trees/Linked Lists ?

Given an arbitrarily complex expression of the above format, there
should be a result available in a scalable manner,,

the parsing is available in PL/sQL and I am aware of that ..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top