Hello,
I'm trying to adding attributes dynamically to an xmlelement. All the attributes are stored in a table.
So what I did is creating a column that holds the attributes in one line e.g.: "sal"="1000" mgr="9827"
So now I've a query like this:
select XMLElement(evalname ename)
from emp;
Which gives me:
<scott></scott>
<james></james>
...
What I want to do is add that attribute to the element so I get
<scott "sal"="1000" mgr="9827"></scott>
...
What I tried is:
select XMLElement(evalname e1.ename, XMLAttributes(e2.my_attributes))
from emp e1, (select ename, '"sal"="100" "mgr"="9876"' my_attributes from emp) e2
where e1.ename = e2.ename
But that results in:
<SCOTT MY_ATTRIBUTES=""sal"="100" "mgr"="9876""></SCOTT>
Anyone an idea how to get arround this? I tried with updateXML but I still have the quotes that get escaped.
Or is there a better way to dynamically add attributes that are stored in a table?
Thanks so much.
Regards,
Dimitri
----------------------------------
http://dgielis.blogspot.com/
http://www.apex-evangelists.com/