Xml search for specific node/attribute

Hi,
I load an xml in as3 and need to find and output (as an
XMLList) a specific node with a specific attribute (example:
<xs:element name="abcd"> ), or at least find out its path
(after, I would know what to do to get the XMLList). I looked at
the XPath classes for Actionscript but the documentation is very
poor and I did not see any method doing this. Could someone help me
please? If no method exists, how can I loop through all the xml and
test each node to see if it is the proper node I am looking for?
thanks so much in advance for your help
Pierrot

You could do it this way, using the descendant accessor:
var xml:XML =
<data xmlns:xs="
http://www.w3.org/2001/XMLSchema">
<xs:element name="abcd">
<tagA>hjfhsldf</tagA>
<tagB>dummy stuff</tagB>
</xs:element>
<xs:sequence>
<xs:element name="dd">
<tagA>words</tagA>
<tagB>dummy stuff too</tagB>
</xs:element>
</xs:sequence>
</data>;
var xs:Namespace = xml.namespaceDeclarations()[0];
var nodelist:XMLList = xml..xs::element.(@name=="dd");
trace(nodelist)
If you need generic code that accounts for no namespaces, you
can use
something like this:
var xs:Namespace = xml.namespaceDeclarations()[0];
var nodelist:XMLList =
(xs == null || xs == undefined)
? xml..element.(@name=="dd");
: xml..xs::element.(@name=="dd");
trace(nodelist)

Similar Messages

  • Search For Specific File Type (eg .txt)

    I know how how to find files in a folder using Java but how do you search for specific file types. I am looking only include files with the extension .txt in my search.

    Cheers. I already looked at that. Got a program that parses a XML and had a play about with it. Can print the contents of tags in my XML. Its just that im trying to parse my XML and have the contents of the starts_with tag to appear in startsWith(or a variable to which this has been assigned) and the contents of the extension tag to appear in endsWith. Totally clueless on how to go about it.
    Below is my class. Would be greatful if you have any ideas.
    import java.io.File;
    public class FindLatestFile {
                 public static File getLatest(File thisDir){
                         long latestModDate = -1;
                         File latestFile = null;
                         File[] fileList = thisDir.listFiles();
                         for(int i=0; i < fileList.length; i++){
                             File file = fileList;
         if (file.lastModified() > latestModDate & (file.getName().startsWith("A") & file.getName().endsWith(".txt"))) {
         latestModDate = file.lastModified();
         latestFile = file;
                             return latestFile;

  • TS3595 I am unable to "search for specific songs or artists in iTunes on my new I pad

    I am unable to "search for specific artists or songs in iTunes using my new iPad 3rd gen.  I am not  really great with all things computer but can follow step by step instructions pretty well. Any suggestions?

    Click the + sign above My Stations to create a new station then type a Genre, Artist or Song in the search box.

  • Search for specific values (no *) in RSUSR070

    I want to find all activity groups that contain a specific entry for authorization object P_ORGIN, Personnel Area field.  I want to search for FL02 for example, but if I type FL02 in the selection field, I will also get any activity group that contains * as the value for Personnel Area.  I tried putting FL02 in single quotes but that did not work either.
    Any ideas?
    Thanks,
    Cindy

    Alex69 wrote:
    Thanks for the answer…
    I thought maybe I'm doing something wrong or this is because i excluded the Time Machine volume from spotlight, but ok, not my fault, but an apple "feature"
    I could search for specific E-mails using a finder search and then switch into Time Machine, but since Mail is called a Time-Machine-Aware Application I felt there should be a direct way to do this in Mail…
    Yes, there "should be a direct way to do this."
    The approach you describe above will work for email that still currently resides on your Mac, for example an email that has been "Replied" back and forth and you wish to retrieve an earlier version of the conversation. Or perhaps a "Draft" email that has undergone changes over time, of which you need to retrieve an earlier version. In these cases using Time Machine is relatively straight forward.
    My problem with Mail/Time Machine is with a specific email that has since been deleted. Unless you know exactly what mailbox that email had been in, and at what time the email had existed, then it can be like searching for a needle in a haystack. In this case the Time Machine interface needs to have a search box added to the "time travel" windows for faster retrieval of specific items, the location of which the user doesn't remember.
    I'm convinced, though, that the usability of Time Machine in such instances will improve over time. Particularly as more app become integrated with it.
    Glenn

  • Search for specific E-mail in Time Machine?

    Hi,
    I have a problem with searching for E-mails in Time Machine.
    When I search for E-mails of a specific address or subject in Mail and can't find it, I enter Time Machine and in Time Machine the "search field" of the mail window is empty and all E-mails are shown.
    I found no way to filter the E-mails and it's difficult to find an E-mail when all E-mails are listed.
    I also can't use a intelligent folder with my search criteria, cause they are greyed out in Time Machine.
    Is this a "normal" behaviour or am I doing something wrong?

    Alex69 wrote:
    Thanks for the answer…
    I thought maybe I'm doing something wrong or this is because i excluded the Time Machine volume from spotlight, but ok, not my fault, but an apple "feature"
    I could search for specific E-mails using a finder search and then switch into Time Machine, but since Mail is called a Time-Machine-Aware Application I felt there should be a direct way to do this in Mail…
    Yes, there "should be a direct way to do this."
    The approach you describe above will work for email that still currently resides on your Mac, for example an email that has been "Replied" back and forth and you wish to retrieve an earlier version of the conversation. Or perhaps a "Draft" email that has undergone changes over time, of which you need to retrieve an earlier version. In these cases using Time Machine is relatively straight forward.
    My problem with Mail/Time Machine is with a specific email that has since been deleted. Unless you know exactly what mailbox that email had been in, and at what time the email had existed, then it can be like searching for a needle in a haystack. In this case the Time Machine interface needs to have a search box added to the "time travel" windows for faster retrieval of specific items, the location of which the user doesn't remember.
    I'm convinced, though, that the usability of Time Machine in such instances will improve over time. Particularly as more app become integrated with it.
    Glenn

  • Efficient searching in a large XML file for specific elements

    Hi
    How can I search in a large XML file for a specific element efficiently (fast and memory savvy?) I have a large (approximately 32MB with about 140,000 main elements) XML file and I have to search through it for specific elements. What stable and production-ready open source tools are available for such tasks? I think PDOM is a solution but I can't find any well-known and stable implementations on the web.
    Thanks in advance,
    Behrang Saeedzadeh.

    The problem with DOM parsers is that the whole document needs to be parsed!
    So with large documents this uses up a lot of memory.
    I suggest you look at sometthing like a pull parser (Piccolo or MPX1) which is a fast parser that is program driven and not event driven like SAX. This has the advantage of not needing to remember your state between events.
    I have used Piccolo to extract events from large xml based log files.
    Carl.

  • Can't search for specific tag - Dreamweaver 8

    All of a sudden, I can no longer search for a specific tag in
    Dreamweaver 8 (Mac OS 10.4.6). It was working fine and I had just
    run a sitewide search, then boom! The attribute plus (+) and
    minus(-) signs appear over the text "Search:" right next to the
    dropdown box that says Specific Tag. It only happens in the tag
    search option.
    Clicking on the plus or minus does nothing, and when I try to
    run the search, I receive the error that one of my attribute fields
    is empty.
    I've tried a reinstall and restart, but that did nothing.
    Please help!! I NEED this function! Thanks.

    Shutdown DW and manually delete the Preferences file.
    I can't remember where to find the file on the Mac, so
    hopefully one of
    our Mac gurus can chime in here!
    Thanks,
    Randy
    > All of a sudden, I can no longer search for a specific
    tag in Dreamweaver 8
    > (Mac OS 10.4.6). It was working fine and I had just run
    a sitewide search, then
    > boom! The attribute plus (+) and minus(-) signs appear
    over the text "Search:"
    > right next to the dropdown box that says Specific Tag.
    It only happens in the
    > tag search option.
    >
    > Clicking on the plus or minus does nothing, and when I
    try to run the search,
    > I receive the error that one of my attribute fields is
    empty.
    >
    > I've tried a reinstall and restart, but that did
    nothing.

  • Find Label Missing in Advanced Search For Specific User

    for specifi users FIND label is showing but some of the users in advanced search this find label is missing . top of the applictaion it is there
    plz let me know why this is problem is coming
    find button should visible to all users......................
    give me repaly ASAP

    Hi
    CRM 5.0
    its not related to application,modification ..but my problem is the find label is working for some of the users.but some of the users find label is not there,
    plz let me know where i have to make corrections for this problem........

  • Search for own settypes / attributes of iObject

    Hello,
    i created some Z-Settypes with own Z-Attributes for individual objects in CRM.
    I also created the assignmentblocks for this Z-Settypes. Now i´m able to maintain the Z-Attributes in Webclient UI.
    My next step would be to search for individual objects (view PRDIOQR/SEARCH) using my Z-Attributes.
    Does anybody know what i need to do?
    The view is already enhanced.
    I found in GENIL_BOL_BROWSER own notes with my settypes.
    No i need to know how to bring this on the search view to search with my Z-Attributes for i objects?
    Thank you
    Best regards
    Manfred

    Hi Anne,
    Have a look of the <a href="http://service.sap.com/~form/sapnet?_SHORTKEY=01100035870000647973&_SCENARIO">CIC cookbook</a>. This might help.
    <b>Reward points if it helps!!</b>
    Best regards,
    Vikash.

  • Search for specific user in an Active Directory group

    Hello,
    I have an OU containing a number of Groups. Each group contains a number of members.
    I'm currently retrieving the entire list of members from each group by searching for the members attrib for each group. This is not an ideal approach as the query execute time is a bit too long.
    from what I can tell, the group class is group (opposed to a groupofuniquenames). Is there a way to query for the specific member?
    Thanks

    Thanks for the reply.
    I have read the first post you gave, but not the second. I'm off to read that now.
    My main concern is that I don't have access to the DN of the user in the member attrib. I have access to their CN and uid (which is indexed). From what I can recall from when I last updated this code, I couldn't create a wildcard search filter e.g.,:
    (&(cn=All Scientists)(objectClass=Group)(member=CN=Albert Einstein*))
    If that's correct and I require a DN, is there any way around this?
    I was interested in the posixGroup and groupOfUniqueNames classes. I wasn't aware that these were available through Active Directory, but I see them listed in the AD schema (http://msdn.microsoft.com/en-us/library/ms683908(VS.85).aspx).
    If I'm correct, posixGroup would allow for a filter of (&(cn=All Scientists)(objectClass=posixGroup)(memberUid=AEinstein))
    I'm not sure how typical it is to use the posixGroup class in AD and I'll have to check with my AD team before moving forward with this. But I wanted to get some more direction/ideas before asking them to create some posixGroup objects for me.
    I'm now going to go and read the second post you linked, but I wanted to put the rest of my details out there.
    Thanks again.

  • Search for specific text in numerous forms

    Hi,
    Looking for help to find forms that use hardcoded database links.
    Earlier in Forms 4.5 we used to convert all the 100 and odd forms to .fmt and then search in the fmt files for specific text. Forms 6i converts pl/sql code into something else hence we are not able to use the same technique as earlier. Does anyone have any suggestions for doing this in 6i.
    Thanks

    Forms 6i will also do a proper Forms Doc / Object List Report from the command line (eg f60gen script=no build=no forms_doc=yes batch=yes module=${MOD} userid=${CONNECT_STRING} module_type=${TYP} output_file=${OUT} module_access=file)
    The .txt output can be readily searched

  • Preview crashes when I search for specific words in (a) specific document(s).

    Here is a reply I wrote to someone else who had the same issue.  I don't believe their solution applies to my situation, because their problem was fixed when they upgraded to Mavericks.  I have been using Mavericks since it came out, but I have been having this problem ever since I got my MacBook Pro more than 2 years ago.
    ===========
    If I search for a particular word or combination, preview crashes.  It happens much more often when I am searching multiple PDF's at once.
    It really does seem incredibly random.  I could type the word "experiential" into the search box, and it will crash.  I can restart Preview and do the same search over and over and it will always crash after typing a specific letter in the word (i.e., it will crash EVERY time I get to the T in "experiential."
    To get around it, I have resulted to searching for the last half of words I want to find.  I will search for "iential" instead of experiential or "ingency" instead of contingency.
    It is truly insane.  On any given day, I never know what search word will crash with what document.  But in any given session of a few hours, I know the same words will cause the same document or group of documents to crash over and over.
    And it doesn't just happen sometimes.  I would say it happens with about 25% of the words I search for.  Again, I am search several documents at once, which may contribute to my problem being worse.  But, this shouldn't be happening at all.
    I have trashed the preferences files and repaired all permissions.  No help.   AAAAAGH!

    Do a backup.
    Quit Preview.
    Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder. Remove the following. You may not find them all. Restart and test.
    Containers/com.apple.Preview
    Containers/com.apple.quicklook.ui.helper
    Preferences/com.apple.Preview.LSSharedFileList.plist
    Preferences/com.apple.Preview.SandboxedPersistentURLs.LSSharedFileList.plist
    Saved Application State/com.apple.Preview.savedState
    Credit Linc Davis  for this solution.

  • Search for a node in a tree

    I have a standard APEX tree on a in the side bar region of a page. (using Oracle 10g APEX 3.1.0)
    The tree displays and functions just fine. The initial display of the tree is the first 2 levels.
    My users would like a search function of some sort that would expand the tree to only those levels that would match their search criteria.
    For example if I had the following tree
    Animals
    |-Mammals
    | |-Canines
    | | |-Dogs
    | | |-Wolves
    | | |-Foxes
    | |-Felines
    | | |-Cats
    | | |-Lions
    | | |-Tigers
    |-Birds
    | |-Raptors
    | |-Eagles
    and so forth
    and it was initially displayed
    Animals
    |-Mammals
    |-Birds
    |-Fish
    and so forth
    the user would like to search for Canines or Dogs or Raptors (only 1 criteria at a time) and have the tree expand to the proper branch/node.
    I would provide a Search Tree button to initiate the search (refresh the page).
    Anybody done this?
    Bob

    Hi Bob,
    Here is an example were this is possible
    http://www.oracle.com/technology/pub/articles/spendolini-tree.html
    Kind regards,
    Iloon

  • How to SEARCH for specific file TYPES, e.g. PDF?

    If I know the title has in it "resume" and I know it's a PDF, how do you search for all PDF files that have the word "resume" in the title?
    AND..
    How would you search all PDF files that had the word "supervisor" inside the document?
    Thanks

    Command F should do it. Once the search window appears, you should see a drop down box headed kind and next to it one headed any. Select PDF from the any one. Click the plus button, and another field will appear and you can see again more drop down boxes. You just want to set these up so you end up with name and contains, you can then add your text to the remaining field.
    Also see [this|http://apps.tempel.org/FindAnyFile/index.html]
    Message was edited by: gumsie

  • Searching For Specific Information in a ListBox

    I have a program that users enter data into a listbox. It has gotten to the point where it would be great to search for an entry using a phrase then the results be displayed into a label or different ListBox. The data is organized by date and information.
    It would be great if you were able to search for an entry using the date or meal (part of the info entered and saved). Any suggestions for a beginner?

    If each item in your ListBox contains several pieces of information, it might be better to use a control that provides multiple columns such as ListView or DataGridView. That way you could have a column for dates, a column for meals and columns for any other
    piece of information.
    You will still need to write code to do your search, but you can concentrate on searching for dates in the date column and meals in the meal column.

Maybe you are looking for

  • Training and Event management in ESS

    We have 2 services in Training & Event management. 1. PV7I - Training centre 2. PV8I   - My bookings These two services have to be provided in ESS portal. Is there any way to configure it in SPRO???? or is it necessary to manually create iview in por

  • Designer 7.1

    I have just loaded Designer version 7.1 and some of the files are now opening in Acrobat (and Preview) with the following error message: "ado2xfa operation failed. Item cannot be found in the collection corresponding to the requested name or ordinal.

  • Enums programs are not executing....?

    class Shop1 enum Shop {SWEET,HOT} Shop sh; public class TestEnums public static void main(String[] a) Shop1 s1=new Shop1(); s1.sh=Shop1.Shop.SWEET; this is the code which i tried to compile by using java1.5 but it is giving compilation error as ';' e

  • Firefox Maximizes by Itself After Being Minimized, even if I am working on something else, it will maximize and come to the forefront of my screen...can this be stopped?

    While I have the FF browser minimized and I am working on another application or in another browser, the FF browser will maximize and jump up on my screen automatically. This happens often while it is minimized. There are no pages that would seem to

  • Switched to MAC from Windows

    Help. I switched to MAC from Windows XP. I understand that you have to restore the settings so IPOD nano however by doing this it appears that I lose everything. How can I save all music that is saved to my NANO so I do not lose it?