Add the XML attribute

Right now I work with a very simple .xml file that retrieves data ultimately resulting in the generation of run-time components. Here is a simplified version:

< data >
< article type = "Button" x = "50" y = "100" label = "Button 1" / >
< article type = "Button" x = "50" y = "300" label = "Button 2" / >
< / data >

I figured out how to remove an attribute, such as the "label" with this:

If (. name(). attributes() [i] myXML.item [0] == "label" "")
{
delete myXML.build.item [0]. attributes() [i];
i-- ;
}

Now, the question is how can I add another attribute - like the "height"? Any help would be greatly appreciated. Thank you.

Okay, I just stumbbled on the solution:

x 1. @["name"] = "test 2"; "

This seems to do. I don't know if the reverse works just not or if I did it all just bad. Thanks for your help.

Tags: Flex

Similar Questions

  • How to add the XML attribute to an element using BPEL assign

    I have a xml request to a bpel process that contains no attribute.
    After some process, I need to create this missing attribute and specify a value.

    I tried to use the XML fragment in the business to be divested. But how do I create an attribute?
    This XML node which I am trying to create an attribute is a very large knot with many dynamic typing(xsi:type). I can just re - create the complete xml code with the required nodes.

    Anyone know how I can create an attribute xml using the BPEL entitlement? I don't want to use the Java code in my process.

    Thank you.

    You can use the attribute bpelx:insertMissingToData on the item to copy, for example:




    Query="/client:process/@time"/ >

    If not there is time of the attribute in the process element, it will be added.

  • How to add custom XML attributes

    How to add the custom attribute recusrivly. With the order of the sequences.

    Before xml: -.

    var myxml:XML =

    < root >
    < leval0 >
    < leval1 >
    < leval2 > < / leval2 >
    < leval2 > < / leval2 >
    < / leval1 >
    < leval1 >
    < leval2 > < / leval2 >
    < leval2 > < / leval2 >
    < / leval1 >
    < / leval0 >
    < / root >

    After xml:

    var myxml:XML =

    < root >

    < leval0 levalid = '0' >

    < leval1 levalid = "0_0" >

    < leval2 = "0_0_0" levalid > < / leval2 >

    < leval2 = "0_0_1" levalid > < / leval2 >

    < / leval1 >

    < leval1 levalid = '0_1' >

    < leval2 = "0_1_0" levalid > < / leval2 >

    < leval2 = "0_1_1" levalid > < / leval2 >

    < / leval1 >

    < / leval0 >

    < / root >

    Call this method

    trace (AddAttribute (myXML));

    method

    private void addAttribute(node:XML,_depth:String_=_""):XML

    {

    If (node.hasComplexContent ())

    {

    var int count = 0;

    var: String prefix = 0< depth.length="" depth="" +="" "_"="" :="">

    var currentAtt:String;

    for each (var nodeItem:XML of in node.children ())

    {

    currentAtt = prefix + count;

    nodeItem.@levalid = currentAtt;

    addAttribute (nodeItem, currentAtt);

    Count ++;

    }

    }

    return the node;

    }

  • Where to add the transitional attribute at the level of the entities or view level? And where to use {return getTransientAttribute()} in the entity or view?

    Mr President

    JDev 12.2.1.

    Where to add the transitional attribute at the level of the entities or view level?

    And where to use {return getTransientAttribute()} in the entity or view?

    public Number getAmount()  
      {  
        return getTransientAttribute();  
        //return (Number) getAttributeInternal(AMOUNT);  
      }  
    
    

    Concerning

    A difference I could think: place a transient attribute on EO level will make transaction dirty (DBTransaction.isDirty returns true) when the field is changed.

    From a design point of view, I tend to place the transient fields at the level VO, because most of the time they are for the presentation of the data in the user interface.

    Only when the transient fields are involved in DML operations (for example when you call a stored procedure EntityImpl.doDML) I place the transitional area on EO.

  • How to remove the value of the XML attribute in the Indesign file with javascript

    Hi all

    How to remove the value of the XML attribute in the Indesign file.

    1.jpg

    What error is this?

    in any case try this as well (one another),

    var myDoc = app.activeDocument;
    attrDelete(myDoc);
    function attrDelete(elm)
    {
        for (var i = 0; i < elm.xmlElements.length; i++)
        {
            try{
                for(j=0; j
    

    Vandy

  • Add the xmltype attribute node

    How can I add an attribute node to xml in an xmltype?
    Say that I
    declare
      t_xml xmltype;
    begin
      t_xml := xmltype( '<x a="1"/>' );
    end;
    How can I manipulate this variable t_xml become
    <x a="1" b="2"/>
    Anton

    Depends on the version.

    Before 11.2.0.3:

    SQL> with t as (  select xmltype('') as t_xml from dual )
      2  select insertchildxml(
      3           t_xml
      4         , '/x'
      5         , '@b'
      6         , '2'
      7         )
      8  from t;
    
    INSERTCHILDXML(T_XML,'/X','@B'
    --------------------------------------------------------------------------------
    
     
    

    On 11.2.0.3, by using XQuery Update:

    select /*+ no_xml_query_rewrite */
           xmlquery(
            'copy $d := .
             modify ( insert node attribute b {$val} into $d/x )
             return $d'
            passing t_xml
                  , '2' as "val"
            returning content
           )
    into t_xml
    from dual
    ;
    

    (not tested, but should be close)

    Marco Gralike wrote:
    You should be able to build up the little together 'back' in a dynamic method, but for now, don't ask me how (mark)?

    The generic approach would require market the entire tree down recursively to the copy existing nodes and add the new in the right place.
    Although XQuery (without involving XQUF) can do it, it's more of a task for XSLT:

    SQL> with t as (  select xmltype('') as t_xml from dual )
      2  select xmltransform(
      3           t_xml
      4         , xmlparse(document
      5  '
      6    
      7    
      8    
      9      
     10        
     11      
     12    
     13    
     14      
     15        
     16      
     17    
     18  '
     19           )
     20         , q'{att="'2'"}'
     21         )
     22  from t;
    
    XMLTRANSFORM(T_XML,XMLPARSE(DO
    --------------------------------------------------------------------------------
    
    
     
    
  • [CS5 - JS] Definition of the XML attributes from variables...

    Hello

    I'm building a XML variable to store the information needed to run my script.

    The XML structure is quite simple:

    var = new XML document ("< document > < pages > < page / > < / pages > < / document >");

    Every 'page' nodes are added using a simple statement.

    If I need to add an attribute to a node of 'page' I usually use this method:

    document.pages.page.@height= 210;

    What happens if I need to add an attribute without knowing its name (because it is stored in a variable)?

    Y at - it something like that? :

    document.pages.page.setAttribute (Name, 210);

    Have no idea how to handle this...

    Try this:

    document.pages.page['@'+var_name] = 210;

    @+

    Marc

  • How to add the transient attribute for LOV (object of the view read-only)

    I have a view called CustomerView and attribute DepartmentId is present in it.

    Also exists DepartmentView and CustomerView.DepartmentId has an LOV from this point of view.

    I need to add a transient attribute to CustomerView which express the DepartmentName attribute in the LOV.

    Because of the view are read-only there is no entity object don't match them.

    How can I write the groovy for the transitional object expression.

    The name of the view accessor Lov's DepartmentView1

    Looking for your help. Thank you.

    Hi gcoban

    I do not understand your question correctly,

    you are not able to write to the expression property in viewObject?

    or you want to know how to write groovy for that?

    for writing groovy you need viewAccessor and you who have, you can try as Alejandro Tovar Lanz suggested

    or you can write code in RowImpl to fill in the name of the Ministry of the accessor

    See -https://blogs.oracle.com/adf/entry/combo_lov_how_to_display

    Thank you

  • POOR RECOVERY OF THE XML ATTRIBUTE VALUES

    Hi all

    I searched this forum and the web a way to get the value of an xml attribute. The solutions I found always had a problem, the values returned when concatenated without any separators, so I can't know every value.

    Here's how:

    BEGIN

    l_bfile: = BFILENAME ('CTEMP1', nome_fich);
    DBMS_LOB. FileOpen (l_bfile);
    DBMS_LOB. LoadFromFile (l_clob, l_bfile, DBMS_LOB.lobmaxsize);
    DBMS_LOB. FileClose (l_bfile);
    xmlx: = XMLTYPE (l_clob);
    Str: = xmlx. Extract('rowset/Row/@id'). GETSTRINGVAL();

    dbms_output.put_line (' :'|| id values) (STR);
    END;

    Returns the string str: 123456654321 for this example

    <? XML version = "1.0" encoding = "UTF-8"? >
    rowset <>
    < row id = "123456" >
    < name > Peter < / name >
    < / row >
    < row id '654321' = >
    < name > Louis < / name >
    < / row >
    < / lines >


    I want to get each id concatenated for example values (123456:654321) instead, I get the concatenated values (123456654321).


    Does anyone know a work around for this problem?


    Cordially Pedro.

    11.2 you can use listagg()

    SQL> with t as (select xmltype('
      2    
      3      Peter
      4     
      5     
      6      Louis
      7     
      8    ') xcol from dual)
      9  select listagg(v.val,':') within group (order by null) val
     10  from t,xmltable('/rowset/row/@id'
     11  passing t.xcol
     12  columns val varchar2(1000) path '.') v;
    
    VAL
    ------------------------------------------------------------------------------------------------------------------------
    123456:654321  
    

    If not 11.2

    SQL> with t as (select xmltype('
      2  
      3  Peter
      4  
      5  
      6  Louis
      7  
      8  ') xcol from dual)
      9  select xmlquery('fn:string-join(/rowset/row/@id,'':'')'
     10  passing by value t.xcol  returning content) val
     11  from t;
    
    VAL
    ------------------------------------------------------------------------------------------------------------------------
    123456:654321
    
  • With the help of the XML attributes in itemRenderer and labelFunction

    Hello!

    I searched for hours and read the Devguide but always impossible to find the solution to my problem.
    I have a xml returned from php like this:
    < files >
    < record id = "1" name = "name_1" type = "0" / >
    < record id = "2" name = "name_2" type = "0" / >
    < record id = "3" name = "name_3" type = "1 / >"
    < / documents >

    I can bind the result returned from the HTTPService to a data grid:

    < mx:DataGrid dataProvider = "{ret_XML.record}" width = "500" number of rows = "20" editable = "false" id = "dg" > "
    < mx:columns >
    <!-NEXT WORK! ->
    "< mx:DataGridColumn headerText ="Name" dataField="@name " width ="300"/ >
    <!- LABELFUNC don't DO NOT WORK IN LINE NEXT->
    "< headerText ="Type"dataField="@type mx:DataGridColumn " labelFunction ="labelFunc">
    < / mx:DataGridColumn >
    "< headerText ="Id"mx:DataGridColumn dataField="@id " editable ="false">
    < mx:itemRenderer >
    < mx:Component >
    <!-LINE FOLLOWING IS don't DO NOT WORK! ->
    "{< mx:Button label="{data.@id} '/ >
    < / mx:Component >
    < / mx:itemRenderer >
    < / mx:DataGridColumn >
    < / mx:columns >
    < / mx:DataGrid >

    and I have a labelFunction like this:

    private void labelFunc(item:Object,_column:DataGridColumn):String {}
    return "Type:"+ item.@type; "
    }

    So, my problem is that when I bind the column to an XML attribute, it works fine but when I try to link it to an itemRenderer or use it in a function, it does not work. I'm trying for hours now, but just can't make it work.
    I tried:
    "{< mx:Button label="{data.@id} '/ >
    < mx:Button label = "{data. () @id)} »/ >
    "{< mx:Button label="{@data.id} '/ >

    and perhaps others but no luck...
    Please someone help me with this one!

    Ty:
    [Pig]

    Problem solved!

    Well, post it on the forum after I solved my problem as follows:

    So in itemRenderer just use data.attribute () with the desired XML attribute name

    And in the labelFunction:

    private void labelFunc(item:Object,_column:DataGridColumn):String {}
    return "Type:"+ item.attribute ('type'); '.
    }
    Even with itemRenderer but rather data use () item.attribute

    I hope that this is the 'official' solution too...

    [Pig]

  • Retrieves the value of the XML attribute for multiple element sequence

    Guys,

    I have already posted this in the forum XML DB, but some of you could help me.


    I have searched for a solution for this and couldn't quite. I'm trying to get multiple entries in a node attribute values. It workes for a single node, but for many nodes, it fails. Could you please give me a solution?

    SQL> select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
      2        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@NAME') CITY_NAME
      3        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@POPULATION') POPULATION
      4  from xmltable('WORLD' passing xmltype('
      5  <WORLD>
      6  <COUNTRY NAME="INDIA">
      7  <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      8  </COUNTRY>
      9  </WORLD>'
     10  ));
     
    COUNTRY_NAME CITY_NAME POPULATION
    ---------------------- ------------------ -------------------
    INDIA MUMBAI 10000
    When I execute the same for several nodes, it fails, please guide me. Please also let me know how to handle if I have an XML file that contains this data.

    SQL> select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
      2        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@NAME') CITY_NAME
      3        ,extractvalue(column_value, '/WORLD/COUNTRY/CITY/@POPULATION') POPULATION
      4  from xmltable('WORLD' passing xmltype('
      5  <WORLD>
      6  <COUNTRY NAME="INDIA">
      7  <CITY NAME="MUMBAI" POPULATION="10000"></CITY>
      8  <CITY NAME="CHENNAI" POPULATION="2000"></CITY>
      9  <CITY NAME="BANGALORE" POPULATION="13000"></CITY>
     10  <CITY NAME="HYDERABAD" POPULATION="14000"></CITY>
     11  </COUNTRY>
     12  </WORLD>'
     13  ));
    select extractvalue(column_value, '/WORLD/COUNTRY/@NAME') COUNTRY_NAME
                                                                      *
    ERROR at line 1:
    ORA-19025: EXTRACTVALUE returns value of only one node
    See you soon
    Sarma.

    So, this is the first step:

    SQL> with test as
      2  (select xmltype('
      3                 
      4                 
      5                 
      6                 
      7                 
      8                 
      9  ') resp from dual)
     10  select country
     11       , cities
     12  from xmltable('WORLD/COUNTRY' passing (select resp from test)
     13                         columns country varchar2(50) path '/COUNTRY/@NAME'
     14                               , cities xmltype path '/COUNTRY/CITY') world
     15  /
    
    COUNTRY         CITIES
    --------------- --------------------------------------------------
    INDIA           
    

    two columns, a varchar2 and an xmltype.

    Then do the same with the second column, pass the XML to the function XMLTABLE

    SQL> with test as
      2  (select xmltype('
      3                 
      4                 
      5                 
      6                 
      7                 
      8                 
      9  ') resp from dual)
     10  select country
     11       , cit.name
     12       , cit.population
     13  from xmltable('WORLD/COUNTRY' passing (select resp from test)
     14                         columns country varchar2(50) path '/COUNTRY/@NAME'
     15                               , cities xmltype path '/COUNTRY/CITY') world
     16     , xmltable ('CITY' passing cities
     17                columns name varchar2(50) path '@NAME'
     18                      , population number path '@POPULATION'
     19                ) cit
     20  ;
    
    COUNTRY         NAME                                               POPULATION
    --------------- -------------------------------------------------- ----------
    INDIA           MUMBAI                                                  10000
    INDIA           CHENNAI                                                  2000
    INDIA           BANGALORE                                               13000
    INDIA           HYDERABAD                                               14000
    
  • No data is recovered to add the Dimension attribute in Excel

    Hi Experts,

    IAM facing the question below when retrieving values for an attribute dimension in excel, add in.

    We have three types of regime, namely AAAA/BBBB/CCCC, which have been refreshed to Essbase. BENAMER will get data on YYYY revenues and employee data of the CCBC through an XREF function.

    While recovery data on revenues for the attribute ATTRI1 to the size of the merge attribute member, if we collect of AAAA, he has no problem while when pull us the BENAMER, at the business unit level parent values extracted successfully, but when we drill down to a profit of level 0 Center then values are not recovered. Attributes are associated with level 0 of the dimension of the base members. The above works fine when extract us data from a data form by using the connection of planning.

    Any help is appreciated on the above.

    Thank you.

    So your fragmented senior level members are dynamically calculated?

    I wonder if it is interacting with the order of the attribute size calc and not rewarding as you wish.

    The SER60 has a lot of good things about the attributes: http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/html_esb_dbag/dattrib.htm

    You can think of to senior level members in the function stored/never share and see if you get the result you're looking for. If the function is sparse, I should think long and seriously if I really want these members to be calculated dynamically due to the impact on retrieval performance.

    Kind regards

    Cameron Lackpour

  • Hide the XML attribute if no data value / doesn't exist

    Hello

    I have a xsd defined as the following structure:
    --------------
    < xsd: complexType name = "PersonImageType" >
    < xsd: attribute name = "ID" type = "xsd: Integer" / >
    < xsd: attribute name = "FileName" type = "xsd: String" / >
    < xsd: attribute name = "ErrorMessage" type = "xsd: String" use = "optional" / >
    < xsd: attribute name = "Fetched" type = "xsd: String" / >
    < xsd: attribute name = "S1" type = "xsd: String" / >
    < xsd: attribute name = "S2" type = "xsd: String" / >
    < / xsd: complexType >
    --------------

    When I run my BPEL process, I get the reply/output as follows:

    --------------
    < PersonImage >
    "" < PersonImage ID = "12410276" FileName = "12410276.jpg" ErrorMessage ="" recovered = "Y" S1 = S2 "Y" = "Y" / >
    < / PersonImage >
    --------------

    When you look at the output, the xml 'ErrorMessage' attribute has no value in it.
    I want to:
    (a) hide this attribute - when there is no data and
    (b) display this attribute - when it has all the data.

    Very appreciated if someone help me solve this problem.

    Thank you and best regards,
    Rakesh

    without double quotes around the @ErrorMessage

    see you soon
    James

  • Add the dimension attribute

    Hello

    Anyone know how to add the attribute dimension on Hyperion Planning?

    Thanks in advance.

    Kind regards
    Stephan

    Hello

    If you have more than 1 size of the attribute associated with a dimension, then when you reverse the planning application in the dimension you will get a column for every dimension of the attribute.

    So if you have a TestAttrib1, TestAttrib2 associated with the entity, reverse dimension model.

    Look in the entity of the inverse model dimension, you will see the TestAttrib1 and TestAttrib2 columns.

    Now in your workload file, you can load into the columns in your source file.

    Ok?

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Add the xml tag to specific words in a block of text

    Hi all

    I'm sure that it is not too complicated, but after hours of experimentation, research and reading, I can't look at it from the right angle. I'm trying to find a way to search for a specific word ('Figure' in my case) in a given text frame and add a corresponding XML tag automatically. I found a lot of information on how to apply it to a page item as a whole, but there no approach seems to work. Because I am fairly new to InDesign scripting, a little nudge in the right direction would be a huge help.

    Regards and thanks in advance.

    Julian

    Hi Julian,.

    Is - it ask you?

    var doc = app.activeDocument;
    app.findTextPreferences.findWhat = "figure";
    var found = doc.findText();
    
    for(var i =0;i
    

    Kind regards

    Cognet

Maybe you are looking for

  • How always show Images in Thunderbird for MacBook Pro

    I sent you an e-mail with an article on how to load remote images in your thunderbird. Please see the link below: http://www.ashout.com/always-show-images-or-remote-content-in-Thunderbird/This may work for a PC, but it does not work on my MacBook Pro

  • A Web site search more the way it's supposed to with Firefox 4.

    IHeartNYMuseums.com load is more correctly with Firefox 4. He worked every day until yesterday when I opted for Firefox 4. (I also tested with IE and it does not seem to load there either, so it may or may not be a problem in Mozilla Firefox). Any ti

  • Open connection datasocket 42 error

    Hello When I run my application as a stand-alone application from the "open Datasocket connection' VI, I get error 42, I could see using the"Enable debbuging"function in the build specification.  When I run my application in the source code I have no

  • Windows do not disconnect!

    I have a pavilion laptop and windows does not disconnect I clicked on shut down, restart nothing happens Help!

  • HPE-590uk: need help on the best card GeForce

    Well, I tried to upgrade GT 420 2 GB to EVGA GT 740 Superclocked 4 GB DDR3 Dual DVI HDMI PCI - E Graphics Card seems it's not compatible with my HPE-590UK Just wouldn't start... If anyone can help wat graphics card is compatible with my pc please...