Add attributes dynamically to xmlelement

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.enameBut that results in:
<SCOTT MY_ATTRIBUTES="&quot;sal&quot;=&quot;100&quot; &quot;mgr&quot;=&quot;9876&quot;"></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/

Couldn't get the attribute part dynamically in there yet. Maybe sth like this:
SQL>  select * from xmltable('for $i in ora:view("emp")/ROW
                          return element {ora:view("dept")/ROW[DEPTNO=$i/DEPTNO]/DNAME}
                                    {for $j in $i/&#42; return attribute {$j/node-name(.)} {$j}}
COLUMN_VALUE                                                                   
<RESEARCH EMPNO="7369" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17
" SAL="800" DEPTNO="20"></RESEARCH>                                            
<SALES EMPNO="7499" ENAME="ALLEN" JOB="SALESMAN" MGR="7698" HIREDATE="1981-02-20
" SAL="1600" COMM="300" DEPTNO="30"></SALES>                                   
<SALES EMPNO="7521" ENAME="WARD" JOB="SALESMAN" MGR="7698" HIREDATE="1981-02-22"
SAL="1250" COMM="500" DEPTNO="30"></SALES>                                    
<RESEARCH EMPNO="7566" ENAME="JONES" JOB="MANAGER" MGR="7839" HIREDATE="1981-04-
02" SAL="2975" DEPTNO="20"></RESEARCH>                                         
<SALES EMPNO="7654" ENAME="MARTIN" JOB="SALESMAN" MGR="7698" HIREDATE="1981-09-2
8" SAL="1250" COMM="1400" DEPTNO="30"></SALES>                                 
<SALES EMPNO="7698" ENAME="BLAKE" JOB="MANAGER" MGR="7839" HIREDATE="1981-05-01"
SAL="2850" DEPTNO="30"></SALES>                                               
<ACCOUNTING EMPNO="7782" ENAME="CLARK" JOB="MANAGER" MGR="7839" HIREDATE="1981-0
6-09" SAL="2450" DEPTNO="10"></ACCOUNTING>                                     
<RESEARCH EMPNO="7788" ENAME="SCOTT" JOB="ANALYST" MGR="7566" HIREDATE="1987-04-
19" SAL="3000" DEPTNO="20"></RESEARCH>                                         
<ACCOUNTING EMPNO="7839" ENAME="KING" JOB="PRESIDENT" HIREDATE="1981-11-17" SAL=
"5000" DEPTNO="10"></ACCOUNTING>                                               
<SALES EMPNO="7844" ENAME="TURNER" JOB="SALESMAN" MGR="7698" HIREDATE="1981-09-0
8" SAL="1500" COMM="0" DEPTNO="30"></SALES>                                    
<RESEARCH EMPNO="7876" ENAME="ADAMS" JOB="CLERK" MGR="7788" HIREDATE="1987-05-23
" SAL="1100" DEPTNO="20"></RESEARCH>                                           
<SALES EMPNO="7900" ENAME="JAMES" JOB="CLERK" MGR="7698" HIREDATE="1981-12-03" S
AL="950" DEPTNO="30"></SALES>                                                  
<RESEARCH EMPNO="7902" ENAME="FORD" JOB="ANALYST" MGR="7566" HIREDATE="1981-12-0
3" SAL="3000" DEPTNO="20"></RESEARCH>                                          
<ACCOUNTING EMPNO="7934" ENAME="MILLER" JOB="CLERK" MGR="7782" HIREDATE="1982-01
-23" SAL="1300" DEPTNO="10"></ACCOUNTING>                                      
14 rows selected.

Similar Messages

  • JS -- XML Question - Can I add attributes using Javascript?

    I want to add an attribute to an element tag, but I don't see how to do it programmatically. Is it possible? Also, is there a way to name an element tag dynamically? For example:
    The way to add a child element is to either use the appendChild method like this:
    XMLObject.appendChild(<childElement/>);
    XMLObject.childElement= "something";
    or just add it like this:
    XMLObject.childElement = "something";
    Right? (Side Question: Is there a difference between these two methods?).
    What I want to do is to either add a dynamic attribute to a statically named child, or to create a dynamically named child.
    I haven't been able to figure this out myself. Any ideas?

    Maybe have a look at Mozilla's E4X tutorial: https://developer.mozilla.org/en/E4X_Tutorial/
    There's no need for eval() here. (There usually isn't.) Use:
    XMLObject.appendChild(<{nameReference}/>);
    To add an attribute, you can just use:
    XMLObject.@new_att = "the value";
    Jeff

  • How to add attributes in the xml tag

    hi,
    i have two tables employee,department
    employee table
    empno number,
    empname varchar2(100),
    deptno number,
    department table
    deptno number,
    deptname varchar2(100)
    i want xml file in the above mentioned two tables.The xml file is as follows,
    <?xml version="1.0" encoding="UTF-8" ?>
    <EmployeeInfo>
    <Data type="employee">
    <empno>1</empno>
    <empname>siva</empname>
    <deptno>10</deptno>
    </data>
    <Data type="department">
    <deptno>10</empno>
    <deptname>IT</empname>
    </data>
    </EmployeeInfo>
    can anybody please give plsql code for this requirement.i need to add attributes in the xml tag.Its urgent
    By
    Siva

    A general example (based on the OE sample data/tables)
    SQL>SELECT XMLElement("Emp",
      2                     XMLAttributes(employee_id AS "id"
      3                                  , '10' "dept"),
      4                     first_name||' '||last_name) as result
      5 FROM   employees e
      6 WHERE  department_id = 10;
    RESULT
    <Emp id="200" dept="10">Jennifer Whalen</Emp>

  • Want to add Image Dynamically...

    I want to add image dynamically in my output screen..so is there any code that i can use..Please help with this...

    Can you please be more specific about what you want to do dynamically.  Do you just want to dynamically control which image appears in an image UI element (which can be done by data binding a context attribute to the image Source property) or do you want a dynamic number of images (which can be done with a row repeater or multipane UI element and inner Image UI elements).

  • Formatting Attributes Dynamically

    My program currently adds side labels/attributes dynamically; however, I cannot seem to format them (i.e., bold). I am using Brio Intelligence 6.6. Please advise.

    hi sarath,
          Hope u have queried regarding screen attributes..
      u can use the loop at screen for changing the attributes dynamicaly..
    r1 type radiobutton group a.
    loop at screen.
    screen-name = 'R1'.  " r1 is field name make sure u write in caps
    screen-input = 0.
    screen-invisible = 0.
    endloop.
    u can check SCREEN table in se11 u can get the attributes which u can change dynamically..so use the syntax SCREEN-ATTRIBUTE NAME....
    hope i have answered u..
    regards,
    Rajkumar.G

  • How to add column dynamically based on user input in oracle?

    **how to add column dynamically based on user input in oracle?**
    I am generating monthly report based on from_date to to_date below is my requirement sample table
    EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE | 01-OCT-12 | 02-OCT-12 | 03-OCT-12
    100001.............John...........02-OCT-12...............6
    100002.............chris...........01-OCT-12...............4
    Based on user input, that is, if user need the report from 01-OCT-12 TO 03-OCT-12, i need to add that dates as column in my table, like 01-OCT-12 | 02-OCT-12 | 03-OCT-12....
    below is my code
    create or replace
    procedure MONTHLY_LVE_NEW_REPORT_demo
    L_BUSINESS_UNIT IN SSHRMS_LEAVE_REQUEST_TRN.BUSINESS_UNIT%TYPE,
    --L_LEAVE_TYPE_CODE           IN SSHRMS_LEAVE_REQUEST_TRN.LEAVE_TYPE_CODE%TYPE,
    L_DEPARTMENT_CODE IN VARCHAR2,
    --L_MONTH                    IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
    L_FROM_DATE IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
    L_TO_DATE in SSHRMS_LEAVE_REQUEST_TRN.LVE_TO_DATE%type,
    MONTHRPT_CURSOR OUT SYS_REFCURSOR
    AS
    O_MONTHRPT_CURSOR_RPT clob;
    v_return_msg clob;
    BEGIN
    IF (L_BUSINESS_UNIT IS NOT NULL
    AND L_FROM_DATE IS NOT NULL
    and L_TO_DATE is not null
    -- AND L_DEPARTMENT_CODE IS NOT NULL
    THEN
    OPEN MONTHRPT_CURSOR FOR
    select EMPLOYEE_CODE, EMPLOYEE_NAME AS NAME, DEPARTMENT_CODE AS DEPARTMENT,DEPARTMENT_DESC, CREATED_DATE,
    NVL(WM_CONCAT(CL_RANGE),'') as CL_TAKEN_DATE,
    case when NVL(SUM(CL2),0)<0 then 0 else (NVL(SUM(CL2),0)) end as CL_BALANCE,
    from
    SELECT DISTINCT a.employee_code,
    a.EMPLOYEE_FIRST_NAME || ' ' || a.EMPLOYEE_LAST_NAME as EMPLOYEE_NAME,
    a.DEPARTMENT_CODE,
    a.DEPARTMENT_DESC,
    B.LEAVE_TYPE_CODE,
    B.LVE_UNITS_APPLIED,
    B.CREATED_DATE as CREATED_DATE,
    DECODE(b.leave_type_code,'CL',SSHRMS_LVE_BUSINESSDAY(L_BUSINESS_UNIT,to_char(b.lve_from_date,'mm/dd/yyyy'), to_char(b.lve_to_date,'mm/dd/yyyy'))) CL_RANGE,
    DECODE(B.LEAVE_TYPE_CODE,'CL',B.LVE_UNITS_APPLIED)CL1,
    b.status
    from SSHRMS_EMPLOYEE_DATA a
    join
    SSHRMS_LEAVE_BALANCE C
    on a.EMPLOYEE_CODE = C.EMPLOYEE_CODE
    and C.STATUS = 'Y'
    left join
    SSHRMS_LEAVE_REQUEST_TRN B
    on
    B.EMPLOYEE_CODE=C.EMPLOYEE_CODE
    and c.EMPLOYEE_CODE = b.EMPLOYEE_CODE
    and B.LEAVE_TYPE_CODE = C.LEAVE_TYPE_CODE
    and B.STATUS in ('A','P','C')
    and (B.LVE_FROM_DATE >= TO_DATE(L_FROM_DATE, 'DD/MON/RRRR')
    and B.LVE_TO_DATE <= TO_DATE(L_TO_DATE, 'DD/MON/RRRR'))
    join
    SSHRMS_LEAVE_REQUEST_TRN D
    on a.EMPLOYEE_CODE = D.EMPLOYEE_CODE
    and D.LEAVE_TYPE_CODE in ('CL')
    AND D.LEAVE_TYPE_CODE IS NOT NULL
    group by EMPLOYEE_CODE, EMPLOYEE_NAME, DEPARTMENT_CODE, DEPARTMENT_DESC, CREATED_DATE
    else
    v_return_msg:='Field should not be empty';
    end if;
    END;
    my code actual output
    EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE
    100001....................John............02-OCT-12.................6
    100001....................chris...........01-OCT-12.................4
    how to add column dynamically based on from_date to to_date?
    Thanks and Regards,
    Chris Jerome.

    You cannot add columns dynamically. But you can define a maximum number of numbers and then hide unused columns in your form useing SET_ITEM_PROPERTY(..,VISIBLE, PROPERTY_FALSE);

  • Add Subform dynamically,on click of Button, in Interactive form generated by Adobe Document Services

    HI,
    I have an XDP file designed by Adobe Designer 7.1 with the following hierarchy of elements:
    -form1(root)
    --Button
    --tmpForm (subform - Repeat subform for each data entry )
    ---ST (Text)
    Now, this XDP file generates an Interactive PDF form with Reader Rights enabled by the Adobe Document Services.
    On click of button, the following javascript is executed on client side:
    var df = _tmpForm.addInstance(1);
    df.ST.rawValue = "HI" ;
    xfa.host.messageBox( "Instances" + tmpForm.all.length ) ;
    On clicking the button, i get the length of the instances of the subform and the size increases on each click, but no element is added "visibly" to the pdf.
    But when i try to do the same by saving the XDP file as Dynamic PDF form for Acrobat 8.0,and open it using Adobe Acrobat PRO 8.0, it works fine.
    My question is,I s it not possible to add subforms dynamically in PDF's generated by Adobe Document Services with Reader Rights enabled?
    Or, is there something that i am missing?
    Please guide.
    Thanks.
    Regards,
    Siddhartha

    Hi,
    you can't change the behavior of the save button in the browser nor in Reader/Acrobat.
    You can add a custom button within your form which calls a custom script from a folder level script using the browserForDoc method.
    The browseForDoc methos is the only one whcih can change the name in the saveAs dialog.
    Here's an example., you can run from Acrobat console.
    You need to combine it with the solution from the other thread to make it work with your form.
    http://forums.adobe.com/message/2266799#2266799%232266799
    var oRetn = app.browseForDoc({
        bSave: true,
        cFilenameInit: "MyForm.pdf",
        cFSInit: "",
    if (typeof oRetn !== "undefined") {
        this.saveAs({
            cFS: oRetn.cFS,
            cPath: oRetn.cPath,
            bPromptToOverwrite: false

  • How can i add a dynamic header value in to the pdf

    I am using a AssemblerService (Invoke DDX) to modify a Pdf file. How can i enter a dynamic value into the header using ddx ?
    DDX used
    <DDX xmlns="http://ns.adobe.com/DDX/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ns.adobe.com/DDX/1.0/ coldfusion_ddx.xsd">
        <PDF result="Out1">       
            <PDF source="Doc2">
                <Header>
                    <Right>
                        <StyledText>
                            <p>"here i need to add a dynamic data from the process"</p>
                        </StyledText>
                    </Right>
                </Header>
            </PDF>
        </PDF>
    </DDX>
    Thank You.

    Insertion Point is a placeholder Object which is used to dynamically replace while assembling. Search through the assmber guide to get any hints.
    Nith

  • How to add attributes in Cost Objects via Data Bridge?

    Hi everyone,
    I need your help. I want to know if is possible to add attributes via Data Bridge in Cost Objects tables like the country or address of a customer?
    Thanks for all.
    Sincerely,
    Pedro Sousa

    Hi,
    Jef is right you need to use the different values in the "Attribute Flag" field for creating attribute hierarchy using data bridge.
    For attribute Hierarchy you need to use option 12 & 15 depending on your requirement.
    12  - Attribute Assignment  - Used for assigning attribute to a member of the main hierarchy
    15  - Attribute Hierarchy only - used for creating hierarchy within attribute hierarchy.
    As mentioned by Jef for details you can refer the Data bridge user guide section 4.3.
    Regards,
    Niraj

  • Add panels dynamically to a frame

    I have a main class called Mainframe. I want to be able to add panels dynamically to this. Lets take for example that I have 2 objects. The first one is called random1 and the other one is called random2. All they do is generate random numbers. I want the 2 of these to take up half the screen.I want random1 to be at the top with the remaining fitting in under them. I want this to be able to support whatever number is present at runtime.
    e.g.
    .MainFrame .
    .          Number:24          .     
    .          Number:66          .
    How can I achieve this?

    Please! no sarcasm, You arent giving qwwerty a chance to post his code.
    I'm sure he's got a lot to offer and just waiting for the right opportunity.
    Ok qwwerty, when you're ready....

  • How to add Image dynamically in Webdynpro ABAP

    Hi Experts,
    How to add Image dynamically in Webdynpro ABAP.
    My requirement is i maintain all the images in a table.
    image source has to pick the table URl dynamically and display.
    is that possible in webdynpro?
    and also please give the suggesion,
    without using MIME objects is that anyway to get images?
    Thanks in advance.
    Regrads,
    Jeyanthi

    Hi,
      are those icons wou want to display then. he following code will be useful.
    data : lo_IMG type ref to CL_WD_IMAGE.
    LO_IMG = cl_wd_IMAGE=>new_IMAGE( id = img_id SOURCE = 'ICON_BW_APD_TARGET' tooltip = sts_tltp ).
    lo_cont->add_child( the_child = lo_img ).
    here lo_cont is the container where you want to add the image dynamically and source is the attribiute through which you can change the ICON image. this thing you can getit from data base table and change accordingly.
    Regards,
    Anil kumar G

  • Add Subform dynamically,in Interactive form in WebDynpro

    HI,
    I an using NW2004s SP9  and have an Interactive form designed by Adobe Designer 7.1 from within the NetWeaver Developer Studio, with the following hierarchy of elements:
    -form1(root)
    --Button
    --tmpForm (subform - Repeat subform for each data entry )
    ---ST (Text)
    The Webdynpro application displays the Interactive PDF form with Reader Rights enabled by the Adobe Document Services.
    On click of button, the following javascript is executed on client side:
    var df = _tmpForm.addInstance(1);
    df.ST.rawValue = "HI"  ;
    xfa.host.messageBox( "Instances" +  tmpForm.all.length ) ;
    On clicking the button, i get the number of the instances of the subform and the size increases on each click, but no element is added "visibly" to the pdf.
    But when i try to do the same by saving the XDP file as Dynamic PDF form for Acrobat 8.0, and open it using Adobe Acrobat PRO 8.0, it works fine.
    My question is,I s it not possible to add subforms dynamically in PDF's generated by Adobe Document Services with Reader Rights enabled?
    Or, is there something that i am missing?
    Please guide.
    Thanks.
    Regards,
    Siddhartha

    HI Dezpo,
    Thanks a lot for replying.
    I had checked the updated <b>SAP Note 834573</b> -Interactive Forms based on Adobe software: Acrobat/Reader version, which states that:
    For SAP Interactive Forms by Adobe, you require the following:
    Adobe Acrobat as of Version 7.0.9
    Adobe Reader as of Version 7.0.9
    <b>Important:</b>
    Note that you can only have limited use of Reader 8.0 for forms that, at runtime, are integrated in a WebDynpro application through the xACF technology (Active Components Framework). In this runtime environment, Reader 8.0 currently only supports static interactive forms. If you are using <b>dynamic interactive PDF forms</b>, we recommend that you use <b>Reader 7.0.9.</b> In the application, you can use parameters, or you can call methods, to determine whether you want to create a static or dynamic PDF form.
    I tried with the reader versions - 7.0.7,  7.0.9 and 8.01, but it doesn't work for either of them.
    Regards,
    Siddhartha Jain

  • How to Add the Dynamic List Wizard Form to a Spry Accordion Panel?

    Is it possible to add ADDT Dynamic Forms to the Spry Widgets?
    - I have been trying to add the Dynamic List Wizard to my existing Accordion but everytime I do, the Accordion turns into plain text?
    -Also, If it is possible then how do I target the Panels and have the detail record open up in Panel number 2?
    I plan on having the ADDT Dynamic Form in Panel 1, and want the Add, Edit, New, Delete form to open up in Panel 2.
    Thanks for your help,
    jlig

    I figured this out.
    1) First add all the Fields to the Form using the ADDT Insert Record Form Wizard.
    2) View the ADDT form in the browser to make sure the fields all display.
    3) In DW design view, move the cursor just to the left of the ADDT Form and hit Enter to Add a line just above the ADDT Table.
    4) With the cursor below the Red Form line and just above the ADDT table add the SPRY widget. (ex..Tabs)
    5) Now highlight the rows you want to move & hit Cut, then open up Tab1, highlight Content1 and hit Paste.
    I decide to leave my date_added, modified_By & date_modified fields below the SPRY tab widget so that these fields are visible all the time. When I click on the Insert button, the record was added correctly to my Table after Validation passed.
    Thanks,
    jlig

  • How to add Attributes to an asset? [URGENT]

    Hi,
    We are developing an application that need to add attributes to an asset depending on Product associated. Someone knows how to add the attributes automaticlly?
    FYI. We have not licensed the Configurator module.
    Please need an answer ASAP.
    Thanks

    Hi,
    We are developing an application that need to add attributes to an asset depending on Product associated. Someone knows how to add the attributes automaticlly?
    FYI. We have not licensed the Configurator module.
    Please need an answer ASAP.
    Thanks

  • Change report attributes dynamically?

    Can we change the report attributes dynamically? For example, I want to dynamically set some columns to be showed or not. I plan to use a radiogroup, when I choose "Partial View", the report only show some columns; when I choose "Full View", the application changes the column attributes from "hidden" to "shown".
    Anyone knows how to do that in APEX 3.0? Thanks a lot.

    I have a radiogroup, which has two values, 1 for "Partial View" and 2 for "Full View".
    I set the "condition type" to be "Value of Item in Expression 1 = Expression 2", "Expression 1" to be ":P400_RADIO" and "Expression 2" to be "2".
    Anything wrong here?
    Thanks a lot for your quick reply.

Maybe you are looking for

  • VGA resolution out of range

    Complete novice at this have just got myself a Mini tring to use it as a media center with a Sony Bravia KDL S40A12U. Have read about the problems using the two together and tried an app called DisplayconfigX. Tweaked the resolution and installed res

  • Help on JAR creation (newbie)

    Hi guys so I am using Eclipse 3.2 and I click on the project and I say Export to Java --> JAR file then I go to prompt and I do java -jar blah.jar and that gives me an error: Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/driv

  • Can't download free games

    Can't download free games. It shows 'waiting' status...which remains as is!

  • Personal Domain Names

    I know this has been asked before, please be patient with me. I already have my own personal site (mibphotography.com) published using an offsite host that I pay monthly for. The website was created using Contribute. I have redone the website using i

  • Mac mini doesn't boot anymore

    Hello all, all of a sudden my Mac Mini (Macmini3,1) stopped booting: no chime, black screen; nothing happens. I didn't upgrade the hardware. Now I found out that if I reset (== hold down the power switch until powers off, power on again) the mini 3 t