Sort an XMLList on an attribute value?

How do you sort an XMLList (or XMLListCollection) on an
attribute value rather than the element content?
Thanks,
...scott

You use the Sort and SortField objects and assign them to the
collection:
var dummyXML:XML = <testdata><test
field="C"/><test field="A"/><test
field="X"/><test field="Y"/></testdata>;
var sorter:Sort = new Sort();
sorter.fields = [new SortField("@field")];
var tests:XMLListCollection = new
XMLListCollection(dummyXML.test);
tests.sort = sorter;
tests.refresh();
trace("First item [" + tests.getItemAt(0).@field + "] Last
item [" + tests.getItemAt(3).@field + "]");

Similar Messages

  • Xsl:sort order attribute value template

    I am trying the use the following in XDB 10.1.0.2
    <xsl:sort order="{$myOrder} ...
    It appears that the order attribute does not allow an attribute value template.
    Any suggestions would be appreciated.
    Anthony

    This is known bug 1798018 in the Oracle XSLT processor.
    The only workaround I can think of is to use <xsl:choose> to optionally use different <xsl:for-each> blocks, one with order="ascending" and one with order="descending" as literal values.

  • Sorting images mislabeled in Report Attributes?

    I added some custom images in the Sorting section of the Report Attributes. When I ran the report the images displayed were opposite of what I expected (i.e. the descending image displayed for an ascending sort and vice versa.) Upon further investigation it appears that the labels in the Sorting section are indeed reversed. The descending image is displayed when the sort order is ascending and vice versa. Is this a bug?

    Erik,
    Thanks, this explains it. By specifying the request as part of your URL you run into the recently uncovered issue. The request you're setting is REMFROMLIST and ADD2LIST. You probably either have links that include those requests or you have branches where you specify them. Either way, in order to get reports sorting to work, you'll have to make sure that the request strings are not part of your URL. This is a work-around and the upcoming HTML DB patch release will solve this issue.
    One way of avoiding this is to have computations on the previous pages that set a napplication level or page level item to the REMFROMLIST and ADD2LIST values and then you can use those items for your conditions that are currently evaluating those strings.
    Hope this helps and sorry for the inconvenience,
    Marc

  • Setting property attribute values for multiple selected objects.

    Hello,
    Is there an easy way to set the attribute property values for more that one selected Table Operator Attribute (column) at a time. For example the target table has over 100 columns but I only want to INSERT/UPDATE 10 of those columns. The generated MERGE, INSERT and UPDATE statements will perform DML on all of the columns in the target table, setting the 90 columns with no mapping set to NULL. This is due to the Loading Properties 'Load Column when Updating Row' and 'Load Column when Inserting Row' both default to Yes. I would like to select multiple Attributes in the Table Operator and change the 'Load Column when Updating Row' and 'Load Column when Inserting Row' to No. This is similar to what you were able to do in Oracle Forms 9.0 Designer select multiple Items in a Block and change the properties en-masse.
    Thanks

    Hi,
    Using OMB scripting to set attribute properties in a data mapping sort of defeats the purpose of utilizing a graphical user interface to define and set properties for a data mapping? Surely the GUI data mapping tool was created to get away from writing scripts and scripting would also require that you know the name of the data mapping, table operator and the set of attribute names for which you have to write one line of script to set each property value, i.e. 90 lines to set 90 attribute values.
    Cheers,
    Phil

  • Select XML Node by a specific attribute value

    I am newbie for LifeCyle.
    This might be an easy question, but it really got me here.
    I am trying bind xml data into a Drop-Down List. The databinding is working fine, but I would like to have more specific node selected from the xml file by using a attribute value.
    for example Code in AS 3.0
    root.node.(@id=="1").subNode
    How could i do the same thing in LifeCycle Designer 8.0
    Thank you in advance!!!

    there's no native method for this, maybe you should create some functions for this. just like
    private function setAttribute(node:XML, name:String, value:String, index:int = -1):void
        var attrs:XMLList = node.attributes().copy(),
            l:int = attrs.length();
        if(index == -1 || index > l - 1)
            node.@[name] = value;
        else
            delete node.@*;
            var idx:int = 0;
            for (var i:int = 0; i < l + 1; i++)
                if(i == index)
                    node.@[name] = value;
                else
                    var attr:XML = attrs[idx];
                    node.@[attr.name()] = attr.toString();
                    idx++;
    and use it like this:
    setAttribute(myNode, "otherAttribute", "abc", 0);

  • In Jsp TagLib how can I get the Attribute value (like JavaBean) in jsp

    Dear Friends,
    TagLib how can I get the Attribute value (like JavaBean) in jsp .
    I do this thing.
    public void setPageContext(PageContext p) {
              pc = p;
    pc.setAttribute("id", new String("1") );
              pc.setAttribute("first_name",new String("Siddharth")); //,pc.SESSION_SCOPE);
              pc.setAttribute("last_name", new String("singh"));
    but in Jsp
    <td>
    <%=pageContext.getAttribute("first_name"); %>
    cause null is returing.
    Pls HELP me
    with regards
    Siddharth Singh

    First, there is no need to pass in the page context to the tag. It already is present. How you get to it depends on what type of tag:
    Using [url http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/SimpleTagSupport.html]SimpleTagSupport
    public class MyTag extends SimpleTagSupport
      public void doTag()
        PageContext pc = (PageContext)getJspContext();
        pc.setAttribute("first_name", "Siddharth");
        pc.setAttribute("last_name", "Singh");
        pc.setAttribute("id", "1");
    }Using [url http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/TagSupport.html]TagSupport or it's subclass [url http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/BodyTagSupport.html]BodyTagSupport the page context is aleady declared as an implicit object:
    public class MyTag extends TagSupport
      public void doStartTag()
        pageContext.setAttribute("first_name", "Siddharth");
        pageContext.setAttribute("last_name", "Singh");
        pageContext.setAttribute("id", "1");
    }In each case, this sort of thing should work:
    <mytags:MyTag />
    <%= pageContext.getAttribute("first_name") %>I

  • Audit of attribute value change: is the old value available?

    When changing the value of an user attribute in the FIM Portal, the new attribute value is properly logged. This can be read in the request and in the standard report FIMUserHistory.
    The question is, what about the old value that was replaced? Is the old value available in the Data Warehouse somewhere, so one can make a report or is it gone forever (of course one can find the old value by looking at the previous attribute change or creation
    event, but this could be too long time ago)?
    Thanks for helping,
    Didier.

    As far I remember (I don't have access to test FIM Reporting now) in reports stored on Data Warehouse, there is no such thing as "old value". But as far I remember it, also very old data is stored there, so there can be something like:
    User: JJK003 -> New attribute (mail) value: [email protected] (12.12.2013)
    User: JJK003 -> New attribute (mail) value: [email protected] (12.02.2014)
    so, if you look closely to a history and sort it by user - you can determine what was the old value.
    http://technet.microsoft.com/en-us/library/jj133843(v=ws.10).aspx
    In report, you have always most recent display name of this user and of attribute's display name, but history should show what value was inserted long time ago and what value was set a week ago - than you know what value was there previously.
    But please be aware that users report, according to TechNet, does not include all properties:
    This report provides information about changes to key attributes on user resources in FIM, including account name, email, job title, and
    employee start/end date.
    Keep trying

  • How to get the attribute values out?

    Hi everyone,
    <root>
    <category name="Mens Clothing" id="0">
    <subcategory>Active/Baselayer Tops</subcategory>
    <subcategory>Active/Baselayer
    Bottoms</subcategory>
    </category>
    <category name="Womens Clothing" id="1">
    <subcategory>aaa</subcategory>
    <subcategory>bbb</subcategory>
    </category>
    </root>
    How to get the attribute values out? For example "Mens
    Clothing" and "Womens Clothing".
    // the line below returns "Active/Baselayer Tops" and
    "Active/Baselayer Bottoms"
    var myXml:XML = new XML(event.result);
    Thanks,
    May

    Here is attribute identifier operator from FB Help:
    @ attribute identifier Operator
    Usage myXML.@attributeName
    Identifies attributes of an XML or XMLList object. For
    example, myXML.@id identifies attributes named id for the myXML XML
    object. You can also use the following syntax to access attributes:
    myXML.attribute("id"), myXML["@id"], and myXML.@["id"]. The syntax
    myXML.@id is recommended. To return an XMLList object of all
    attribute names, use @*. To return an attribute with a name that
    matches an ActionScript reserved word, use the attribute() method
    instead of the @ operator.
    Operands attributeName:* — The name of the attribute.
    Example
    How to use examples
    The first example shows how to use the @ (at sign) operator
    to identify an attribute of an element:
    var myXML:XML =
    <item id = "42">
    <catalogName>Presta tube</catalogName>
    <price>3.99</price>
    </item>;
    trace(myXML.@id); // 42The next example returns all attribute
    names:
    var xml:XML =<example id='123' color='blue'/>
    var xml2:XMLList = xml.@*;
    trace(xml2 is XMLList); // true
    trace(xml2.length()); // 2
    for (var i:int = 0; i < xml2.length(); i++)
    trace(typeof(xml2
    )); // xml
    trace(xml2.nodeKind()); // attribute
    trace(xml2
    .name()); // id and color
    } The next example returns an attribute with a name that
    matches a reserved word in ActionScript. You cannot use the syntax
    xml.@class (since class is a reserved word in ActionScript). You
    need to use the syntax xml.attribute("class"):
    var xml:XML = <example class='123'/>
    trace(xml.attribute("class"));

  • htmlb:tableView : (table) Attribute value is not a valid reference

    Hi All,
    In Table view i am getting the following error.
    The following error text was processed in the system:
    <htmlb:tableView>: (table) Attribute value is not a table
    My code in View is
    CREATE OBJECT  MODEL TYPE  ZCL_HREPAN_MODEL_MAIN.
    CREATE OBJECT tv_itr1 TYPE ZCL_HREPAN_MODEL_ITR_STATUS exporting model = model.
    %>
         <htmlb:tableView  id              = "reportsTable1"
                           headerVisible   = "true"
                           headerText      = "All PANs:"
                           footerVisible   = "true"
                           design = "alternating"
                           visibleRowCount = "20"
                           width           = "100%"
                           fillUpEmptyRows = "false"
                           columnWrapping  = "false"
                           columnWidth     = "200"
                           sort = "server"
                           selectionMode = "lineEdit"
                           iterator        = "<%=tv_itr1%>"
                           table           = "//MODEL/DATE_RANGE_PAN" >
          </htmlb:tableView>
    in above DATE_RANGE_PAN is table from model 'ZCL_HREPAN_MODEL_MAIN'
    Controller as below:  DO_REQUEST.
    if lr_event is bound and lr_event->server_event = 'allpans'.
      lo_model ?= get_model( 'model_id_status' ).
      lo_display_view->set_attribute( name = 'model' value = lo_model ).
      lo_display_view = create_view( view_name = 'allpans.htm').
      call_view( lo_display_view ).
      ENDIF.
    DO_INIT as below
    lo_model ?= create_model( class_name = 'ZCL_HREPAN_MODEL_MAIN'
                                model_id   = 'model_id_status').
    please help me how to solve this??
    REgards,
    Kishan

    I think DATE_RANGE_PAN is not table. Make sure its a table. If issue persist, post the data type declaration here.
    Raja

  • Read attribute value of a master data object's master data object

    Hi Guys,
    I have a peculiar condition where I need to read attribute value of a master data object's master data.
    Requisition (ZREQUI) is linked to Candidacy (ZCDCY) by object called Recquisition.
    Candidacy  (ZCDCY) is linked to Candidacy Activity (0CDCY_ACT) by object called Candidacy.
    I want to populate attribute called due date in ZREQUI by reading lowest value of due date value of 0CDCY_ACT. There can be multiple hits.
    If I can get the code to do this, I would really appreciate it.

    Here is the outline of the code ,as per my understanding..chk if it can help u
    In start routine write a select statement to pick all the data from 0cdcy_act.
    select 0CDcY_ACT ZCDCY  DuE_DATE from /BiC/P0CDCY_ACT
    into table itab1
    for all entries in source_package
    where ZCDCY = source_package-ZCDCY.
    as you need the lowest due date, sort the iTAB1
    sort itab1 by due_date  ZCDCY.   (default is acending order)
    In the field routine of your due date
    Read table itab1tnto wa_itab1 where
    ZCDCy = source_fields -ZcDcY.
    now duedate = wa_itab1-duedate.

  • Not getting attribute values in IPC routines Scenerio R/3 B2B using AP 7.0

    Hi,
    Our Scenerio is using ISA R/3 B2B using AP 7.0. I have developed IPC routines but when i debug my routines in SM53 I notice that I'm not getting any attribute value except for VKORG.
    I'm pasting the code below. Please help me if I have to implement some BADI or do something more to get the attribute values.
    I have defined the attributes properly in Routine assignment in tcode /n/sapcnd/ueass
    userexitlogger.writeLogDebug("*requirment 901*" + "Plant = "plant"||ANZ_MONATE ="+ item.getAttributeValue(ANZ_MONATE_STR).toString()"||ANZ_JAHRE="item.getAttributeValue(ANZ_JAHRE_STR).toString()"||MATKL="item.getAttributeValue(MATKL_STR).toString()"||PSTYV="item.getAttributeValue(PSTYV_STR).toString()"||VKORG="item.getAttributeValue(VKORG_STR)"||PRSFD="item.getAttributeValue(PRSFD_STR)"||MVGR2="item.getAttributeValue(MVGR2_STR).toString()"||PRSDT="item.getAttributeValue(PRSDT_STR).toString()"||AUDAT="item.getAttributeValue(AUDAT_STR).toString());
    I would reward points for help
    Many Thanks n regards,
    Dipender

    I would like to go through each Value of the xml file and give each Value a name
    e.g. from the xml file <VentCount Value=1> Retreive the value above and giving it the name VentCount. Then I would beable to use the name vent count as follows:
    setVentCount() //My own method can use as follows: setVentCount(VentCount); I would like to do his for ever value, each value with a specific name

  • Passing attribute value in session variable

    Hi All
    I need to store one field value from my SIM form as a session variable and pass them to the next page along with my session, using some jscript stuff or else. Does this make sense?
    If it is possible or anyone have any prior experience please reply.
    Thanks in advance

    We have tested a code-snippet that 'gets' attribute-values from the session:
    <invoke name='getAttribute'>
        <invoke name='getHttpSession'>
            <ref>:display.state</ref>
        </invoke>
        <s>attribute_name</s>
    </invoke>You can try 'setAttribute' in the similar way.
    Thanks,
    Adi

  • Need Help ::  Current row attribute value returning null

      Hi Frds,
    I am facing the problem that
    Current row attribute value returning null............ even though value is there..... plz.. he
    This is the code in PFR
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("queryBtn")!= null)
        String  pPersonId = pageContext.getParameter("ctrlPersonId");
         String rowReference = pageContext.getParameter(EVENT_SOURCE_ROW_REFERENCE);
         OptionsVORowImpl curRow = (     OptionsVORowImpl) am.findRowByRef(rowReference);
        String dtlsItem =  (String)curRow.getFlexValue();   /*  this is returning null value */
    /*  here creating  the hashmap and calling the page with the hashmap*/
    Thanks & Regards,
    jaya
    Message was edited by: 9d452cf7-d17f-4d1e-8e0e-b22539ea8810

    Hi Jaya,
    You want to catch Flexfield values?
    Try below code for catch value.
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("queryBtn")!= null)
    OADescriptiveFlexBean dfb = (OADescriptiveFlexBean)webBean.findChildRecursive("flexDFF"); //get the DFF bean
    OAWebBean dffbean = (OAWebBean)dfb.findChildRecursive("flexDFF0"); //get the field that applies to the attribute1 column that is being rendered
    OAMessageStyledTextBean Stylebean = (OAMessageStyledTextBean)dffbean;
    String dtlsItem  = (String)Stylebean.getText(pageContext);
    /*  here creating  the hashmap and calling the page with the hashmap*/
    Thanks,
    Dilip

  • Not getting all the attributes value from Trusted Recon in eventhandler

    Hi,
    I am not getting the values of all the attributes in hashmap from Trusted recon in eventhandler.
    Following is the hashmap value I am getting :
    Parameter Hashmap value is {re_key=1869, Email=[email protected], Role=Full-Time, act_key=22, User Login=TUser43, Xellerate Type=End-User, Last Name=User43, First Name=Test}
    Please let me know how to get all the attributes value in eventhandler. I need to take some decisions based on these attributes.
    Thanks

    You should be getting all the values in the recon event.
    To get the current user states for all the records in the bulk event use this:
    Identity[] currentUserStates = (Identity[]) eventDataHashMap.get("CURRENT_USER");
    Now when you are looping through your bulkParametersp[], you can use the same get from the currentUserStates:
    Identity currentUser = null;
    currentUser = currentUserStates[counter];
    Now if the attribute is not in your hashmap, you can use:
    currentUserState.getAttributes().get(attribute)
    -Kevini

  • How to get attribute value from standard page ?

    Hi,
    How to get attribute value from standard page ?
    String str = (String)vo.getCurrentRow().getAttrbute("RunId");
    But this value is returning a null value ....
    Can anyone help me to get this attribute value which is actually having a actual value .

    getCurrentRow() would always return null if no setCurrentRow() is used.
    Please check the page design and understand how many rows of VO are there. You can also use the following to get the row:
    vo.reset();
    vo.next();
    Regards
    Sumit

Maybe you are looking for

  • IPod Touch - 2 problems

    This is my first post on the forum, and I'm reasonably new to using an iPod-iTouch. I have an iTouch 4th Gen 64G Running on an old PC (3.4Ghz P4, 768M ram) using iTunes 10.6.x (version before exisiting 10.7). 1 I had a problem when my iTouch was runn

  • Is autofill no longer an option with itunes 10.5?

    I usually just autofill any of my non-itunes purchased downloads, but since I upgraded to itunes 10.5, I cannot find autofill anywhere. When I plug in my iphone, it shows up as a device, but "music" no longer shows up underneath it. On the itunes mai

  • HP Photosmart Premium Fax All-in-One Printer-C309a-new black ink cartridge will not print

    i just installed a new black ink cartridge (manufactured by HP) when print quality became poor in the middle of a job.  it completed the job fine, but when i have tried to print subsequently, only those parts of the document that are in color/greysca

  • What are the normal settings to connect to wifi?

    I visited my friend over the weekend and her school required me to change my airport settings in order to connect to the internet. Ever since I got back, I have been unable to connect to my usual wifi source. If I can, it drops off after a few minute

  • How to change line item numbers

    HI when we are creating sales order, if we enter material number, line item number will be autmaticallly assigned(for eg 10,20,30 ....). if i want to change that number what i have to do(eg: to 1, 4, 5, .....). in standard SAP, the field is grayed ou