Grouping items from parts of an XMLListCollection?

I have made grouping collections before.  This is an odd case, though.
I have an XMLListCollection called menuListCollection. Each member is something like this
<?xml version="1.0" encoding="utf-8"?>
<recipe course="starters">
<title>Bacon-Wrapped Ginger Soy Scallops</title>
<recipeLink>http://www.finecooking.com/recipes/bacon-wrapped-ginger-soy-scallops.aspx </recipeLink>
<ingredients>
<item qty=".25" units="cup" caption="soy sauce" desc="soy sauce" section="Other Groceries" />
<item qty="1" units="Tbs." caption="dark brown sugar" desc="dark brown sugar" section="Pantry Staples" />
</ingredients>
<schedule>
<time label="1h"><instructions><![CDATA[none]]></instructions></time>
<time label="45m"><instructions><![CDATA[Heat oven to 450°F for the Bacon-Wrapped Scallops.]]></instructions></time>
<time label="30m"><instructions><![CDATA[Bake the Bacon-Wrapped Scallops and serve to guests to nibble while you make the final dinner preparations.]]></instructions></time>
</schedule>
</recipe>
I need to work with these 3 bits: Title, RecipeLink, and Time -- grouped by label.  My goal is to easily have a listing of the instructions for all recipes grouped by time labels; that is, all the one hour instructions, all the 45 minute instructions, etc.
Such as:
1 Hour Before Dinner
  - instruction for recipe 1 that has this label
  - instruction for recipe 2 that has this label
for each (var x:XML in menuListCollection){
trace("title="+x.title);
trace("link="+x.recipeLink);
trace("30 minutes="+x..time.(@label=="30m").instructions.text());
gives me
title=Bacon-Wrapped Ginger Soy Scallops
link=http://www.finecooking.com/recipes/bacon-wrapped-ginger-soy-scallops.aspx
30 minutes=Bake the Bacon-Wrapped Scallops and serve to guests to nibble while you make the final dinner preparations.
title=Beet Salad with Oregano, Pecans, and Goat Cheese
link=http://www.finecooking.com/recipes/beet-salad-oregano-pecans-goat-cheese.aspx
30 minutes=Finish assembling the Beet Salad.
Is there an easy way to do this, or do I have to loop each item and make separate arrays?  I'd rather be able to use a grouping collection somehow.

...i would use a XMLListCollection filterFunction for that...
that generates a special view of your collection
r.F.

Similar Messages

  • Grouping items from query for xml creation

    Hello,
    I am working on a new photo gallery that uses categories.
    Each category is stored in a category xml element. then the images
    are stored in the category element. I am having trouble figuring
    out how to create this on the fly. With only one category it works
    fine but I am having diffuculty seperating it into groups. The db
    schema is like this imagePath, imageTitle, imageDesc, category. I
    will post the code i am currently using to create the xml now and
    show where i need the categories to loop. Thanks in advance. I am
    posting a second approach with the code where the query is put in a
    array and then I statacially add in what to look for in the array.
    This approach would be fine if i could make it dynamic and grab the
    Exteriors and Interiors from the catList variable. Thanks again for
    any insight on solving this problem.
    Justin
    Justin

    ...i would use a XMLListCollection filterFunction for that...
    that generates a special view of your collection
    r.F.

  • Group item mystery

    Hi,
    In copying grouped items from my master document to my new document, I use a line similar to the one below.
    masterDoc.groups.item(n).duplicate newSection.pages.item(1)
    (Where n = to the group item number.)
    My question is: What is the logic behind the numbering of these groups? For instance: I could have an item on top of page 3 and it will be groups.item(1) and then an item on top of page 1 that will be groups.item(28)....
    Thanks so much for your help.
    Jon

    I believe the numbering reflects the order in which the groups were created (although there might be an element of back-to-front per layer involved, too).
    Dave

  • How do you select individual items from within a group?

    Hi, All.
    New poster. Forgive me if I miss any forum etiquette.
    Currently using Indesing CS6 on Mac Osx 10.7.4
    I'm a relatively recent convert to Indesign from Quark, and one thing I seem to have continual problems with is selecting individual items from within a group.
    For example I will have a grouped item, such as price marker that is comprised of several individual items, some text boxes, some rectangles.
    I find there is no way to select a rectangle that is currently placed behind a transparent text box without ungrouping the entire item - which isn't really an option.
    The select options (slect next item below etc. just don't work)
    For any Quark users out there, the equivalent command I'm looking for is the cmd+opt+shift click through, which just worked absolutely perfectly.
    I have scoured the internet and forums looking for an answer for this, as I assumed it must be my own lack of knowledge, but I can't find an answer.
    Any help much appreciated.
    Thanks

    Hi, winterm.
    Thanks for the super quick repsonse. Unfortunately that hasn't seemed to have helped me.
    That works fine as long as the grouped items are overlapping or apart, but not when items are entirely behind another item (ie, no part protruding from the group)
    The problem is that if I double click to try and get through a text box to an item that is entirely behind it, then it just switches into text edit mode for the top text box.
    If it helps, could you imagine a transparent text box that is 20x20 with red rectangle centred beneath it that is 10x10. If the 2 items are grouped I cant find any way to select through to the red rectangle without first ungrouping the two.
    Am I going mad?

  • How do I get a web part to display items from a dropdownlist?

    I have a DropDownList that am filling with items from a list. The part of my code that am using to read the list and populating the drop down works just fine. I am now trying to figure out how to display the contents of the drop down on a web part. I know
    it sounds like a straight forward and easy thing to figure out, but I have blanked out. Does anyone have a snippet I can take a look at? This is how I am currently reading from a list to create the drop down...
    protected override void CreateChildControls()
    string title = string.Empty;
    EditorChoices = new DropDownList();
    string siteUrl = "mySite";
    using (SPSite site = new SPSite(siteUrl))
    SPWeb web = site.RootWeb;
    SPList list = web.Lists["testList"];
    SPQuery testQuery = new SPQuery();
    testQuery.Query = "<Query><Where><Geq><FieldRef Name='Title'/>" +
    "<Value Type='Number'>10</Value></Geq></Where></Query>";
    foreach (SPListItem item in list.GetItems(testQuery))
    title = Convert.ToString(item["Title"]);
    EditorChoices.Items.Add(title);
    Controls.Add(EditorChoices);
    base.CreateChildControls();
    ChildControlsCreated = true;
    I basically want to display the items returned from the query, which are now in the dropdownlist, to be displayed on my custom webpart. I really appreciate the help.
    Thanks
    UPDATE: My dropdownlist is a web part property. So when editing the web part, the drop down control appears in the web part property. Now that part is working just fine. The part am having an issue with is, the second part of my requirement is that I want
    to display that same information within the drop down on the web part. Not as another drop down, but just to display them as a vertical text list on the web part.

    Hello,
    >I want to be able to display all the entteries in the dropdown,
    Could you please provide more information? as per your description fisrt part is done, which was filling data in dropdown list. So what is next?
    If you want to get selected value from dropdown or filter value then you may try this link:
    http://bilbrobloggins.com/sharepoint/dropdown-list-box-filter-web-part-in-sharepoint-ndash-part-three/
    http://tmullenssharepoint.wordpress.com/2013/04/12/sharepoint-custom-web-part-properties-from-sharepoint-list/
    Correct me if i misunderstood
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How can I get a number of items from a group

    I'm trying to load assets into a library. Most of the assets are groups. I'd like to label each asset with number of items from that specific group.
    Here is my code:
    var d=app.activeDocument;
    //create empty library
    var library = app.libraries.add(File('mylibrary.indl'));
    for(myCounter = 0; myCounter < d.pages.length; myCounter ++){
        if(d.pages[myCounter].groups.length > 0){
             //how do I get number of items from a group?
             var item_count = ?????
        }else{
             var item_count = '1';
        library.store(d.pages[myCounter].allPageItems);
        library.assets[0].name=item_count;
    Thanks for your help and Happy New Year!!!

    I figured it out!!!
    Here is the solve that worked for me:
    var elems = d.pages[myCounter].groups[0].pageItems.everyItem().getElements();
    var item_count = elems.length;

  • Can a content query web part dynamically query items from a particular that exists in multiple subsites

    I have a site collection with multiple subsites. All of the subsites have a list called "Status" which is using content types for its column management.
    I want to use a content query web part in the parent site level to query 1 item from everyone of these subsites. Is there a way to do this?
    The only way I can do this is if I create an individual content query web part for each subsite as I did not find an option for my content query to query from multiple subsites at once.

    You can do it using CQWP. For instance, if you have a site column called 'Rollup' that is part of your content type, that will be part of all your subsites custom list 'Status'. On the root site CQWP set the source to 'Show item from the following site and
    all subsites' and choose your root site (first image below). Then add 'additional filters' and set the value to 'Yes' as shown in second figure below; you will be able to roll up all the data to the root site like below. Now, you need to decide what query
    field you will use that is unique and that can roll up. 
    Srini Sistla Twitter: @srinisistla Blog: http://blog.srinisistla.com

  • How do I delete items from menu bar  that are not part of the OS

    How do I delete items from menu bar  that are not part of the OS

    Perhaps you could be more specific, as it is a little difficult to answer your question without any details.  I can give you some general ideas though.
    On my machine there are a few applications that have installed items into the menu bar - I'm assuming you are talking about the icons on the right hand side of the top bar. To remove those items, I would generally need to uninstall the program that created them. To do this varies a little from application to application.
    Also, sometimes an application will have preferences that allow you choose if you want to display the item in the menu bar.
    So, my general advice would be that you need to identify the application that placed the item there, and remove it from your computer.  If there is an uninstall program for that application, I would run that in the first instance.
    If you don't actually wish to uninstall the application, you may need to click on the item or run the application and see if there is a setting to not show the menu bar item.
    Hope that helps.
    Ivan

  • Download items from a listviewbyquery web part into excel file

    Hi,
    Am having a doc lib view, I mean, I used listviewbyquery web part to display the items from doc lib.
    Now I have the requirement to download  all those  items in the  listviewbyquery web part to an excel file.
    is this possible.
     help is appreciated!
    Das

    Hi Das,
    Based on your description, you might want to download items as well as documents from a ListViewByQuery web part.
    There is no such API in both SharePoint Object Model or Client Object Model can help to access a ListViewByQuery web part in a page directly like what we can do to
    a list/library, I would suggest you query/download data from the source library using SharePoint Object Model if the query or filter condition in the ListViewByQuery web part is available to you.
    If there is need to do the job against the ListViewByQuery web part directly, a workaround is that we can use JavaScript to gather the data needed(such as item id,
    file URL) from HTML source of the web part in a page, then download the related documents to the local machine using Server Object Model.
    How to search elements in HTML source code using JavaScript:
    http://javascript.info/tutorial/searching-elements-dom
    A code demo about how to download files to local machine:
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/369fb601-e51b-4a36-9246-70cf559133cc/programatically-download-files-from-sharepoint-document-library?forum=sharepointdevelopmentprevious
    Best regards
    Patrick Liang
    TechNet Community Support

  • HOW TO GROUP ITEM BY department (MaNganh)/ Category(MaNhom) in XtraReport from Stored Procedure result ?

    I have stored procedure result, i have succeeded bind it to xtrareport. But how can I group item by department (MaNganh) and category (MaNhom) in XTRA REPORT ? Please help me how to solve it ! (SQL SERVER 2008 R2) (DevExpress 10.2.8)

    I've made ​​it, and successful.By add GroupField: 
    GroupField groupField = new GroupField("MaNhom");
               GroupHeader1.GroupFields.Add(groupField);
               tblCell_Group_MaNhom.DataBindings.Add("Text", DataSource, "MaNhom");
    Thank you for HELP! 
    Master Can

  • Showing updated items from two lists ?

    Hi SharePoint Experts,
    I have created two custom lists in top level site, For accomplishing my task, I have used DataView to show all items from the two lists order by modify. Of course, this DataView webpart showing data but which is not in proper way.
    And also show status column from workflow which is actually from different groups.
    Is dashboards  suitable to my task? Is dashboards capable to show data from two list ? also status column from workflow.
    Appreciate if any suggestions..
    Thank you.

    Hi,
    As you are using SharePoint 2013 you can use the Content search web part to display the data from multiple list.
    Please refer to the similar post, which has detailed steps how to use the content search web part.
    http://sharepoint.stackexchange.com/questions/112085/how-to-get-data-from-multiple-table-or-list-in-sharepoint-2013
    If you still persists to use the Dataview web part, please refer to the following article.
    http://sp2013.blogspot.de/2013/11/two-sharepoint-lists-in-dataview-linked.html
    Please don't forget to mark it as answered, if your problem resolved or helpful.

  • Not able to crawl all items from External content type

    Hello All,
    "All the records in my external content source are not getting crawled, only 1/3 rd of the data are getting crawled."
    Steps:
    I created "External content type" using sharepoint designer which connects to a SQL Server database.
    Have written a SQL View joining 2 tables, which return 9,00,000 rows when executed using the SQL Server management studio.
    I used the default "Business Data Connectivity Service" and "Search Service Application" and made sure the necessary permissions are set.
    Created a External Content source for the search service application and selected the "Business Data Connectivity Service" -> "Crawl selected External datasource" -> <my external datasource i created in sharepoint designer>
    Issue
    When i ran the full crawl for the first time it crawled "3,49,923" records in 01 hour and 07 seconds. And returned 1 error "Error crawling LOB Contents.(Error caused by exception: System.InvalidOperationException. There is an error in XML
    document...)
    Later i removed the below item from the index and started a full recrawl, this time it crawled "3,49,924" records 1 record extra from my previous crawl
    and no errors were returned.
    Please let me know what could be the issue. It doesn't look like the permission related issues as i am able to crawl the 1/3rd of my total data. Also i am able to search the crawled data. I also set the throtteling limit for the "Business data catalog"
    to -maximum 10000000 -default 1000000 which is less than the data it has to crawl.
    SRIRAM

    Hi ,
    I started the change suggested in the link shared by you, but got stuck at a point,
    The field which i set as identifier in BCS earlier is not having unique values. Total rows returned by the sql view is 899000, but the unique values present in the column that is set as identifier is
    3,49,923, which is equal to the number of rows crawled. - Is this the reason why it didnt crawl all records?
    The table that is used in the sql view has composite key, - Is it possible to have multiple identifier in BCS as well?
    Is it possible to make BCS to ignore the identifier? i mean creating BCS without an identifier column?
    Please let me know your suggestions on this.
    Thanks,
    SRIRAM
    Yes, BCS needs a UID. This is so it can figure out changes over time to a single record. Otherwise all changes to a row could be a potential new row without BCS knowing any better.
    Yes, or just have it run off the composite key instead of the field you're using now.
    Nope, BCS needs a UID field like in answer 1 :)
    Good luck!
    My CodePlex -
    My Blog - My Twitter
    Join me at the San Francisco SharePoint User Group!
    If this post helped you or answered your question please remember to mark it! :)

  • I group messaged from my ipad and this has screwed up the way my messages are reveived by my friends (it creates new threads in their phones with my email in place of my contact name) I've stopped messaging from my ipad but the problem remains. Any help?

    I have an iPhone 4S and use the group texting feature ALL THE TIME. I recently updated my iPad to the latest software and made the colossal mistake of continuing my group messaging from my iPad while connected to wifi. Doing this has successfully screwed but every group text thread I am in, to the point where its very hard for those involved in the thread to keep up. When I initially messaged those I was already engaged in text threads with it created a new thread in their phones replacing my name in their phones with my email. At first this was not a big deal but ever since then the people I am messaging have become increasingly frustrated with how my messages come through. If I am messaged in a group text and respond to it, sometimes when I respond it will create an entirely different thread in my recipients phones. So at that point they have to switch threads in order to read what I wrote. The new thread that my phone creates will send the message under my email not my name (related to the contact they have me saved as in their phones). The worst part about it is that there seems to be no rhyme or reason to why or when my phone will send the message as normal or under my email like it did with my iPad. I haven’t messaged from my iPad since these problems immediately began a month ago but the issues still continue. I have tried everything to get this to stop, I’ve turned off my wifi, I’ve had my friends delete the threads that my messages create in their phones. I’ve had them delete my email in their contact lists and nothing has worked. Can you help me? Any info you could provide would be greatly appreciated.
    Note: My phone message no different whatsoever. All the threads have remained the same. The issue is what it is doing to the people that I am messaging.
        Best Regards
             Rick Mulhern
    Message was edited by: Rickapplehelp19

    I have this identical problem.  For a while my group texts didnt show up on my ipad.  Then one day they did, maybe everyone in the group started using the same os version or something.  Ever since my first reply to the group there have been complaints of multiple threads.  I can not find a pattern for when my group text's decide they want to create a new thread. (it doesnt happen every time)  Everyone in the group has deleted the thread, we've all toggled imessage on/off etc.  There still hasn't been a solution.
    Any help would be appreciated.
    Thanks

  • Search syntax for Safari history? how to remove items from specific pages?

    I'm using Safari 5.0.3 and I prefer keeping the browsing history quite long for accessing contents I had been searching in the net some weeks ago.
    However, that way I'm collecting lots of clutter and therefore I'd like to remove selected entries from the history, e. g. from the page where I'm reading daily news etc.
    I tried to use the search field (accessible with Cmd-F in the history view) to search for parts of the corresponding web address, e. g. "http://www.heute.de", but I do not only get the history items from that site but many others from google and other pages.
    So I'd like to know: is there a search syntax to use the search field, like address=www.heute.de* which enables wild cards, operators like OR/AND etc.?
    If not, is there a 3rd party tool which can help or can I use spotlight/the finder to find and remove the unwanted items from the browser history?

    Hi beckmart
    there might be ready-made apps or add-ons to do that - but this may help...
    quit safari, open Home/Library/Safari/History.plist using PrefSetter
    enter the url you want removed in the search box, no need for quotes - say www.google.com
    expand the 'web history dates' section at left to see individual results, then select the first one & shift-click the last (don't use select all) to highlight/select all the results - then press the delete key to remove them. Then save the file.
    Naturally, a backup copy of history.plist would be wise - but the above seems to work very well.

  • Unable to remove the redundant group header from the bottom of page

    Hi,
    In one of my projects in I am facing a problem.
    I need to display the details of all available products of the company. While displaying the details, I need to group the products based on some criteria (like type of product, release date) and the grouping is upto 4 level grouping. Grouping criteria can se said as, I need to firstly group all the products based on the type, then on the Release Date and then on two of the client specific values on the Product.
    Along with this, the view of product details is a thumbnail view (Image on top with all details below that line after line) due to which I need to display multiple (5) products in one row.
    The problem which I am facing is:
    The most important criterion for the customer is that there should not be any wastage of space.
    Secondly, they also donu2019t want to see partial data like only the header data in one page and the Product related Data (Image and Info) on the next page.
    In my case, when first page has insufficient space for the next grouped products, it simply displays the group header on the first page. On the second page, it again displays the group header along with the data.
    For reference, images are available at:
    Image1: http://farm4.static.flickr.com/3454/3224626688_aa3cfb8236_m.jpg
    Image2: http://farm4.static.flickr.com/3373/3224626782_0501cf566f_m.jpg
    My requirement is to remove the redundant group header from the first page as it does not make sense without having any data below it.
    I have tried the following options:
    1. I tried to apply setting "Keep Group Together" on the group and "Repeat Group Header On Each Page". But when I apply this, when my second group has more than 5 products (two rows of data) and space on first page can accommodate only 1 row of data, it moves the data on to the second page instead of keeping the 1st row on first page and 2nd on second page. This solution is not acceptable to the customer as it wastes space.
    2. If I remove setting "Keep Group Together" on all the groups, but keep the "Repeat Group Header On Each Page" and remove the "Keep Object Together" in the details section, I can save space. But this is not acceptable to the user as it leaves dangling headers (Orphaned Header Information).
    Need some pointers to overcome this issue as it is very critical for me.
    Thanks in advance,
    Vibhav Agrawal

    Thanks Raghavendra for your reply.
    These solutions provided on the link are not useful for me because of the peculiar layout of my report.
    In my report I am supposed to show details of multiple items (upto 5/6) in a single row.
    All solutions suggest about adding additional header (below group header) and use the formula to use that header to put the data for initial first object and details section for the subsequent objects.
    But, since i need to display multiple items in same row...and data cannot be set as 'format with multiple columns' in the header, hence this solution does not work for me
    Thanks,
    Vibhav Agrawal

Maybe you are looking for

  • The equivalent of ajax httpRequestObject in JSP

    hello, i am asking if i can get some data from a servlet within a jsp. like in ajax, i send a request to the servlet then getting the required data from the servlet.i want to do the same thing but with java, giving the url of the servlet and getting

  • Not able to save / update SQL Query in Query manager

    Hi, I am using SBO 2005 B PL 25, facing unique problem in Query Manager. There are various queries saved in Query manager, tried updating & creating  / saving new query but not able to do so. System displays messaged as operation completed successful

  • Jar files and class path

    I have a small swing application which connects to an external database and queries something and creates a small report on the local machine. Running from the command line calling the == java MyClass works good. I would like to deploy this to two ot

  • DELETED FILES DO NOT GO TO TRASH

    Every time I delete a file, it does not go to trash, it simply disapear so trash bin is useless. How can I fix this problem? I want my deleted files to be shown in my recycle bin.

  • Suggest if I can use FM 'SAP_CONVERT_TO_TEX_FORMAT'

    Hi, I have a requirement where I need to download the data in the internal table say it_tab into UNIX/PC as .CSV file. For PC first I used FM 'SAP_CONVERT_TO_TEX_FORMAT' which converted the data in it_tab into another table say it_trux. Then I used i