How to search for a text node with a particular value in an xml document with labview

supposing i have the following xml document:
<head>
<book>
<bookname>zio</bookname>
<author>dan</author>
</book>
<book>
<bookname>the spear warrior</bookname>
<author>britney</author>
</book>
<book>
<bookname>the beard</bookname>
<author>derrick</author>
</book>
</head>
i want to search for the author of the book "the beard" using for example the V.I Get first match  of labview to access the the node with value "the beard" and then use Get next sibling  V.I  and Get node text content to get get the author of this book..so my question is how do i write the xpath expression for Get first match so as to access the node with bookname "the beard" instantyly?  am trying to minimise the use of loops because they increase the time duration,..thank you (NB:i dont want to use Get all Matched V.I because it obliges me to use a loop in order to access the name derrick and this increases the time duration for my v.i)
Solved!
Go to Solution.

Since it's all text, why not use a real quick Match Pattern (or Regular Expression, but you don't need that much power here), see attached.
Cameron
To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.
To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
LabVIEW Unit 1 - Getting Started
Learn to Use LabVIEW with MyDAQ
Attachments:
Two-stage match demo.vi ‏8 KB

Similar Messages

  • How To Search For a Text In JTable Column?

    hi there
    i want to search for specific text in a JTable Column
    And If The Text Exists Highlits it?
    any ideas or useful links or tutorials?

    Well, then that would be a Swing related question. Did you search the Swing forum to see how rendering works.

  • How to search for a text string in Reports designer?

    In iDS reports (10gR2), I want to search from top down for a text string was used in one of the queries or triggers. In Forms, you can do it, in reports the related menu item is always seems to be grayed out no matter what item I pick in the Navigator. Is it doable or not? If yes, then how. I don't wanna open each program piece including the queries in the data model, report triggers or program units and look for (by visual scanning) for the text I am searching for. This is crazy. There must be a way to do it. Thanx.

    That is pretty bad for such an expensive report development program. The forms allows it, I wonder why Oracle did not include similar functionality in the reports developer. I knew the conversion to ascii, but during development it is pain in the ... just to search for a simple text string in the related program units in the report, to convert to ascii, do the search and then go back to the developer. Anyway, if that is the only way, there is nothing we can do I guess :(

  • How to Search for text in a word document and replace it

    Hey All ,
    I am able to open up a word document present locally using OLE2 Automation. Now i need to search for a text in that document
    and replace it with another text. How do i achieve this?
    And another issue is when i search for the particular pattern i need to store the pattern that comes after the pattern as i need it for further use before i replace it.
    Thanks And Warm Regards,
    Nischal

    Hey Chen,
    Well before i do the search and edit , I am actually opening a .mts file in word which is happening successfully.
    The issue that i am facing now is I am unable to save it as .doc file through the 'SaveAs' method.
    Here is my code. Can u please tell me what i need to do in order to correct this.
    After i do this conversion i intend to pass the data from the .doc file to an internal table and then do the required change.
    But First i need to save it to .doc type.
    REPORT  MAIN_PROGRAM_2.
    INCLUDE OLE2INCL.
    *Declaration Of OLE2_Object Variables.
    DATA: WORD            TYPE OLE2_OBJECT,
          DOCUMENTS       TYPE OLE2_OBJECT,
          ACT_DOCUMENTS   TYPE OLE2_OBJECT.
    *Declaration of variables
    PARAMETERS PATH       TYPE string.
    DATA:Relative_Path    TYPE string,
         Relative_Path_Save    TYPE string.
    *Declaration of an internal table
    CONCATENATE PATH '\Script.mts' INTO RELATIVE_PATH.
    *Object Creation in order for us to open word
    CREATE OBJECT WORD 'WORD.APPLICATION'.
    PERFORM ERROR_HANDLE.
    *Set visibility property of MS word.
    SET property of WORD 'VISIBLE' = 1.
    *Open A document
    CALL METHOD OF WORD 'Documents' = DOCUMENTS.
    PERFORM ERROR_HANDLE.
    *CALL METHOD OF DOCUMENTS 'ADD' = ACT_DOCUMENTS.
    CALL METHOD OF DOCUMENTS 'OPEN' EXPORTING #1 = RELATIVE_PATH.
    PERFORM ERROR_HANDLE.
    *GET PROPERTY OF WORD 'ActiveDocument' = ACT_DOCUMENTS.
    *PERFORM ERROR_HANDLE.
    **To save the script.mts to script .doc file in order to put it into an internal table
    CONCATENATE PATH '\Script.doc' INTO RELATIVE_PATH_SAVE.
    CALL METHOD OF WORD 'SaveAs' EXPORTING #1 = RELATIVE_PATH_SAVE.
    PERFORM ERROR_HANDLE.
    FREE OBJECT WORD.
    The Save part of the code is giving me an OLE error = 2
    Thanks And Kind Regards,
    Nischal
    Edited by: Nischal HP on Apr 28, 2011 1:53 PM

  • How to search for a badi

    how to search for a badi
    srinivas.

    Hi Srinivas,
    Good
    Check this link
    /people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    Run this program
    *& Report ZNEGI16 *
    REPORT ZNEGI16 .
    TABLES : TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA wa_tadir type tadir.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR
    WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR
    WHERE FUNCNAME = TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT
    WHERE SPRSL EQ SY-LANGU
    AND TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    endcase.
    Solution 2
    1.Get the Package of the program name of the transaction.
    2.Go to Transaction SE18.
    3.Press F4 on the badi definition name.
    4.Click the information systems button.
    5.Give the Package name and press enter.
    6.Select the BADI that is relevant to the application.
    Good Luck and thanks
    AK

  • How to search for upper/lower case using string using JAVA!!!?

    -I am trying to write a program that will examine each letter in the string and count how many time the upper-case letter 'E' appears, and how many times the lower-case letter 'e' appears.
    -I also have to use a JOptionPane.showMessageDialog() to tell the user how many upper and lower case e's were in the string.
    -This will be repeated until the user types the word "Stop". 
    please help if you can
    what i have so far:
    [code]
    public class Project0 {
    public static void main(String[] args) {
      String[] uppercase = {'E'};
      String[] lowercase = {'e'};
      String isOrIsNot, inputWord;
      while (true) {
       // This line asks the user for input by popping out a single window
       // with text input
       inputWord = JOptionPane.showInputDialog(null, "Please enter a sentence");
       if ( inputWord.equals("stop") )
        System.exit(0);
       // if the inputWord is contained within uppercase or
       // lowercase return true
       if (wordIsThere(inputWord, lowercase))
        isOrIsNot = "Number of lower case e's: ";
       if (wordIsThere(inputword, uppercase))
         isOrIsNot = "number of upper case e's: ";
       // Output to a JOptionPane window whether the word is on the list or not
       JOptionPane.showMessageDialog(null, "The word " + inputWord + " " + isOrIsNot + " on the list.");
    } //main
    public static boolean wordIsThere(String findMe, String[] theList) {
      for (int i=0; i<theList.length; ++i) {
       if (findMe.equals(theList[i])) return true;
      return false;
    } // wordIsThere
    } // class Lab4Program1
    [/code]

    So what is your question? Do you get any errors? If so, post them. What doesn't work?
    And crossposted: how to search for upper/lower case using string using JAVA!!!?

  • How to search for the list of portal components that use a certain LOV?

    hi,
    does anyone know how to search for all of those portal components which use a certain other component?
    let's make it specific. how can i know which of the portal components (portal reports and forms, content folders, etc) are using any certain LOV?
    will really appreciate any hints.
    naqvi

    Please ask this question in the Oracle Text forum (formerly interMedia text). You will get the experts that work with it every day there.

  • How to search for a BADI in a transaction

    Hi All,
    Please let me know the steps to find a BADI for a transaction.
    Thanks,
    Jaffer Ali.S

    check this.
    u can find BADI's in different ways...
    1>First go to any transaction->iN THE menu bar SYSTEM->STATUS->Get the program name ->double click->u will go to the program attached to the tcode.Now search term will be CALL CL_EXITHANDLER.Now u will get list of BADI'S available..
    2>Goto SE24->Give class name as CL_EXITHANDLER->Display->double click on get_instance mathod->Now u will go inside the method->Now put break point on the cl_exithandler.Now go to any transaction code and pass dat..U will see that it will be stopped on the break point which u set on the cl_exithandler...In the exit name u can find list of badi's attached to the tcode..
    There are multiple ways of searching for BADI.
    • Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
    • Finding BADI Using SQL Trace (TCODE-ST05).
    • Finding BADI Using Repository Information System (TCODE- SE84).
    1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for ‘CL_EXITHANDLER=>GET_INSTANCE’.
    Make sure the radio button “In main program” is checked. A list of all the programs with call to the BADI’s will be listed.
    The export parameter ‘EXIT_NAME’ for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter ‘INSTANCE’ will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
    2. Start transaction ST05 (Performance Analysis).
    /people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    3. Go to “Maintain Transaction” (TCODE- SE93).
    Enter the Transaction VD02 for which you want to find BADI.
    Click on the Display push buttons.
    Get the Package Name. (Package VS in this case)
    Go to TCode: SE84->Enhancements->Business Add-inns->Definition
    Enter the Package Name and Execute.
    Here you get a list of all the Enhancement BADI’s for the given package MB.
    The simplese way for finding BADI is
    1. chooes Tcode Program & package for that Tcode.
    2. Go to Tcode se18
    3. Press F4
    4. search by package or by program.
    Regards
    Kiran Sure

  • How to search for a certain cross reference using its name in FM 11?

    How to search for a certain cross reference using its name in FM 11?

    Well, thank you. I am only using Find dialog box. By "name", I'd like to give an example. The background is FM 11 structured. I have an element "xref" which is used to make cross reference. Now In Chapter 1, there is a sentence like "This is an ODU for ...". I made a cross ref of the word "ODU" to its full name "outdoor unit" in Chapter 2 (in the same book). After this, the word "ODU" in the sentence in Chapter 1 will no longer be a plain text. So I no longer can use the find dialog box to search for "ODU" because it is already an xref rather than text. I am not if it's clear.

  • Crystal Report Viewer Closes the application after showing "The text cannot be found in the report" when searching for a text in a multipage report

    Post Author: Farooque
    CA Forum: Other
    Hi,
    I am using Crystal report viewer (Crviewer.dll) version 11.0.0.1282 to show crystal reports in my VB6 application. When we search for any text in a multipage report after the last find system shows a message "Crystal Report Viewer" "Text cannot be found in the report" and trows an unhandled error and closes the application. How can I fix this?
    Please help
    Thanks in advance.
    Farooque. ([email protected])

    Enter the following:
    viewer blank net crystal
    into the search box in the top right corner. You should get a number of hits (Kbases and articles) that should point you to a solution.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • AMs and PMs - how to search for small-caps?

    In my book I'm proofreading I have a mixture of (because I was undecided when I was putting it together):
    i 7.00 a.m.
    i 7.00 am
    i 7.00am
    I ran these three options past about twenty people this morning, 6 voted for the first, 8 voted for the second, 3 voted for the third, and 1 person and myself voted for the option I can't show properly here: small-caps: 7.00 AM. Then of course there was the wag who told me: "Why don't you just say '7 o'clock in the morning' "? And the complete ratbag who suggested, in the interests of avoiding confusion: "7.00 am o'clock in the morning before lunch at 0700 hours."
    Before I make them all the same format, which will very likely be small-caps, I want to make sure I can easily search for them so I can replace with an alternative style if I change my mind again later on.
    QUES: How do I search for "AM" and "PM" (spaces before and after) if they are formatted in small-caps? I can't use paragraph styles because the AMs and PMs appear in a variety of styles already.

    Thanks for all the hints. I'm going to try some of them to see how they work. I should make it clear though (my original post may have been unclear about this) that I was asking how to search for AM in small caps AFTER I had changed all time-formats to that form.
    As for why I asked for input: I treat my book a bit like a democracy and give people a chance to vote on certain aspects and make comments just in case they have a good idea that I hadn't thought of; but yes, I'm the boss, and in terms of votes mine counts for 95%. In this case, someone suggested using a colon -- which I have taken on board. So I will be using the time format 7:30 AM to see how it looks. But if I don't like it, I want to be able to find all the small-cap AMs and change them to something else in one go.
    My interest in time-formats has stirred some interest locally. My partner proof reads a walking club magazine and she received the latest edition lat night. She has never concerned about time formats before, but after my foray into different options, she came up with the following variety (the club has lots of reports that include times when walking trips start and end), even though she thought she had done a thorough job of proof reading:
    9 am
    9.00am
    9:00 am
    9:00am
    9.am
    9 AM
    9.00a.m.
    9.00 a.m.

  • Please answer. how to search for files

    Hi,
    We need an integration with SAP. They send us files in the format: yyyymmddhhmiss.atv
    For example we receive following files:
    20050503101115.atv
    20050504101115.atv
    20050505101115.atv
    So, we dont know how to search for all files with extensions ".atv" in the directory.
    We are using PLSQL. Is there some way to resolve with UTL_FILE?
    Any other suggestion?

    A possibility:
    In sqlplus, issue a HOST command to list the files to a file:
    ls *.atv &gt; atv_dir.txt
    Then use utl_file to read atv_dir.txt and parse it for the file names.
    You could put the filenames in a pl/sql table and use that as loop control.

  • In Pages, how to search and replace text involving invisible characters?

    In Pages documents, how to search and replace text involving invisible characters, colors and font sizes—a task which is so easy in Mircosoft Word?

    I read that an older version of Pages allowed users to enter special characters in the search/replace fields, but this did not work for me.
    Here: http://www.macworld.com/article/1156533/pagesspecialcharacters.html
    I still am looking for a way to do this.

  • Search for any text in column filter on adf table

    Hi,
    I have column filter on adf table where I can search for any text starting with by default.
    For e.g. you have data my name is sam you can search on table column filter by my and you get the results my name is sam
    but I want to search by any word let's say sam and I want to display same result.
    Thank you,
    Savan Shah.

    You probably can use wildcards (% and _ )
    for example %my%
    Dario

  • Searching for exact text

    Hi - I've a problem when looking for exact text, eg:
    SetStatusBarMessage AND "C#"
    This matches any words beginning with C - how can I specifically look for the phrase C# ??
    (see the results: http://img12.imageshack.us/img12/5259/screenw.gif )
    Pat Read

    No. There is nobody here who works for Apple, the forum us strictly user-to-user.
    I wouldn't say it's "strictly user-to-user". As terms & conditions states:
    Apple involvement. Apple does not formally provide technical support on the Site. However, any information that is provided by Apple or Apple employees is offered on an "AS IS" basis without warranties of any kind.
    Thanks for the suggestion. Although, the problem is not really to get rid of the message (as you can dismiss it quite easily) but to understand why it appears there in the first place. Is it a malware? is it a bug?
    So thanks for that. Although as you mentioned, it wasn't very enlightening.
    (The 2000 views were probably a couple of years ago. Look at the dates on the posts.)
    I did. Half the people who posted had this issue in 2011, and the other half (including me) posted in the last couple of months. So it might be a recurring thing.
    I have no idea when 2000 users googled "Tap Continue and sign in to purchase a gift" and viewed this post. Could have been 2 years ago or in the last couple of months.

Maybe you are looking for

  • A505 S6033 / Memory Speed Mixing

    Good Day, I have a Satellite A505-S6033 i7 720QM @ 1.6GHz Part Number: PSAT9U-006002 OS/Win7 Ultimate HDD/500GB Memory/6GB [Originally 4GB (DDR3-1066/PC3-8500) only]. I removed one 2GB(DDR3-1066/PC3-8500) memory in the 2nd slot and upgraded the memor

  • My caller id is not working on iphone 5 - it beeps but doesn't show who is calling or let me click over

    I have recently had my iphone 5 not show who is calling on call waiting.  The phone beeps but doesn't show the number / per son that is calling, won't let me click over and won't show who it was in my call history.  Help very annoying.

  • Jpanel is moving, not fix

    Hi there, i am making a swing appl. and there is a jpanel on my window. On jpanel there is a jlabel. When i run application my panel is movind 2-3 mm to the right side. While application is working a few minutes later the jpanel is turning back the i

  • How to disable weblogic built-in HTTP session filter?

    Hi, I want to use my own HTTP seesion filter to manage HTTP session on weblogic clustered servers. It seems that weblogic servers plugin its HTTP session filter already for servlet. How can I use my own HTTP session filter to replace WebLogic built-i

  • Error when trying to add new query on QaaWs

    Hello Using BO XI 3.1 enterprise client tools 'Query as a web service' the following happens: (I was advised by my administrator to reinstall BO which I have done but this error still occurs). 1. Upon loggin on, I receive the message "You are trying