Obtaining the " #text " string in a nodeList !!!!

hello guys,
i just have a bizarre problem, i'm getting the #text string in a nodeList whereas this string does not exist in any of the .xml files.
here is my function:
private Vector<String> getClassAttributs(Document doc)
      String nN="";
      NodeList listeClassAttributes = doc.getElementsByTagName("attribut");
      for(int i=0;i<listeClassAttributes.getLength();i++)
         nN=listeClassAttributes.item(i).getParentNode().getNodeName();
      //  System.out.println(nN);
         if (nN.equals("classe"))
             NodeList children=listeClassAttributes.item(i).getChildNodes();
             for(int j=0;j<children.getLength();j++){
                System.out.println( children.item(j).getNodeName());//here it displays me among other string(that actually exist) the #text (which does not exist)
               //if(children.item(j).getNodeName().equals("valeur"))
                 // System.out.println(children.item(j).getNodeValue());
              //classAttributes.add(children.item(i).getNodeValue());
      return classAttributes;
    }thank you

In your for loop check for node type before printing the value. Something like this...
if (children.item(j).getNodeType()== Node.ELEMENT_NODE)

Similar Messages

  • Is there a way to obtain the text item's value when the mouse pointer at?

    Hi,
    Is there a way to obtain the text item's value when the mouse pointer at? Mouse pointer may be located somewhere out of current record and even out of current block.

    There is a when-mouse-over trigger and that works fine in client-server mode for Forms 5/6/6i, but that is less indicated when deployed using Application Server.
    In that trigger you may write whatever code is necessary, restricted package procedures.
    Still, I think, for your case, if you do not have to deal with a multi-record block, you should use the HINT property for that item and set_item_property with the HINT argument for that item in order to set the hint to the item's value - this should set_item_property should be called on the when-new-record-instance .

  • Problems with string encoding - need the text content in char* format.

    The problem is non ASCII-characters, which comes out as some sort of unicode I need to desipher.
    Here's what I got:
    A text frame object with the TextString "Agnartjørna"
    I get the text content of this object into an ai::UnicodeString the following way:
    AIErr
    VMGetTextOfTextArt( AIArtHandle textArt, ai::UnicodeString &ucStr)
        ASUnicode *textBuffer = NULL;
        AITRY {
            TextFrameRef ateTextRef;
            AIX( sAITextFrame->GetATETextFrame( textArt, &ateTextRef));
            ATE::ITextFrame ateText( ateTextRef);
            ATE::ITextRange ateRange = ateText.GetTextRange( true);
            ASInt32 textLen = ateRange.GetSize();
            AIX( sSPBlocks->AllocateBlock( (textLen+2) * sizeof( ASUnicode), nil, (void**) &textBuffer));
            ateRange.GetContents( textBuffer, (ASInt32) textLen+1);
            /* trim off trailing newlines */
            if ((textBuffer[textLen] == '\n') || (textBuffer[textLen] == '\r'))
                 textBuffer[textLen] = 0;
            ucStr.clear();
            ucStr.append( ai::UnicodeString( textBuffer, textLen));
            sSPBlocks->FreeBlock( textBuffer);
            textBuffer = NULL;
           AIRETURN;
        AICATCH {
            if (textBuffer) sSPBlocks->FreeBlock( textBuffer);
           AIPROPAGATE;
    Now, the next step is to convert it into a form that I can use to call regexp.
    Baiscally, I want to detect the ending "tjørna" (meaning small lake) on a map label, and apply a standard abbevriation "tj^a" (with "a" superscripted).
    So the problem is to obtain the regexp pattern and the text content in same encoding.  And since the regexp library is old *char based, I would like to convert the text content in to plain old *char.
    Hence the following code:
    static AIErr
    VMAbbreviateTextArt( AIArtHandle textArt,
                             vmTextAbbrevEffectParams *params)
        AITRY {
        /* first obtain the text contents of the textArt */
           ai::UnicodeString ucText;
          const int kTextLen = 256;
          char textContent[kTextLen];
          AIX( VMGetTextOfTextArt( textArt, ucText));
          ucText.as_Roman( textContent, kTextLen);
    But textContent now has the value "Agnartj\xbfnna"  (According to XCode),
    which will not get a match on the pattern "tj([øe][rn])na\\" (with  backslash matching the end of the string)
    Any other ways to convert the textContent to a plain *char string?

    Thank you very much, your method will work fine. with
    the "UTF-8" parameter the byte[].length is double,
    cause every valid byte is preceeded by an -62, but I
    will just filter the valid bytes into a new array.
    Thanks again,
    StefanActually what you need to do is to find the character encoding that your device expects, and then you can code your strings in Arabic.
    That's the way Java does things; Strings and char values are always in UNICODE (see www.unicode.org) (which means \u600 to \u6ff for arabic) and uses a specified character encoding when translating these to and from a byte stream.
    Each national character encoding has a name. Most of them are identical to ASCII for 0-127 and code their national characters in 128-255.
    Find the encoding name for your display and, odds are, the JRE has it in the library.
    BTW the character encoding ISO-8859-1 simply maps UNICODE characters 0-255 on to bytes.

  • [Forum FAQ] How to find and replace text strings in the shapes in Excel using Windows PowerShell

    Windows PowerShell is a powerful command tool and we can use it for management and operations. In this article we introduce the detailed steps to use Windows PowerShell to find and replace test string in the
    shapes in Excel Object.
    Since the Excel.Application
    is available for representing the entire Microsoft Excel application, we can invoke the relevant Properties and Methods to help us to
    interact with Excel document.
    The figure below is an excel file:
    Figure 1.
    You can use the PowerShell script below to list the text in the shapes and replace the text string to “text”:
    $text = “text1”,”text2”,”text3”,”text3”
    $Excel 
    = New-Object -ComObject Excel.Application
    $Excel.visible = $true
    $Workbook 
    = $Excel.workbooks.open("d:\shape.xlsx")      
    #Open the excel file
    $Worksheet 
    = $Workbook.Worksheets.Item("shapes")       
    #Open the worksheet named "shapes"
    $shape = $Worksheet.Shapes      
    # Get all the shapes
    $i=0      
    # This number is used to replace the text in sequence as the variable “$text”
    Foreach ($sh in $shape){
    $sh.TextFrame.Characters().text  
    # Get the textbox in the shape
    $sh.TextFrame.Characters().text = 
    $text[$i++]       
    #Change the value of the textbox in the shape one by one
    $WorkBook.Save()              
    #Save workbook in excel
    $WorkBook.Close()             
    #Close workbook in excel
    [void]$excel.quit()           
    #Quit Excel
    Before invoking the methods and properties, we can use the cmdlet “Get-Member” to list the available methods.
    Besides, we can also find the documents about these methods and properties in MSDN:
    Workbook.Worksheets Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff835542(v=office.15).aspx
    Worksheet.Shapes Property:
    http://msdn.microsoft.com/en-us/library/office/ff821817(v=office.15).aspx
    Shape.TextFrame Property:
    http://msdn.microsoft.com/en-us/library/office/ff839162(v=office.15).aspx
    TextFrame.Characters Method (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff195027(v=office.15).aspx
    Characters.Text Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff838596(v=office.15).aspx
    After running the script above, we can see the changes in the figure below:
    Figure 2.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thank you for the information, but does this thread really need to be stuck to the top of the forum?
    If there must be a sticky, I'd rather see a link to a page on the wiki that has links to all of these ForumFAQ posts.
    EDIT: I see this is no longer stuck to the top of the forum, thank you.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Find the width of a text string inside a text box?

    Hi,
    I have a text box with a long text string in it. I would like to know what the width of the text string is so that I can scroll it inside the textbox using the text box scrollviewer.
    var sv = this.foodieItemText.GetFirstDescendantOfType<ScrollViewer>();
    sv.ScrollToHorizontalOffsetWithAnimation(this.foodieItemText.Width, 20);
    The scrolling works fine but I don't know what value to use for the width offset in the first argument to ScrollToHorizontalOffsetWithAnimation. For my purposes I want it to scroll the full length of the text string (which is longer than the actual with of
    the text box). Any ideas?

    Hi duffybr,
    Yes, there is a ScrollViewer inside TextBox template and we could scroll to the specific position as we need, however there is no direct way to get the string width in TextBox, however we could get the width in TextBlock, by measure method.
    See this discussion for more information:
    http://stackoverflow.com/questions/9126076/how-can-i-calculate-the-width-of-a-string-in-metro-without-displaying-it
    Besides, there are some third party libraries help us get the String width.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How Can I replace newScale Text Strings with Custom Values?

    How Can I replace newScale Text Strings with Custom Values?
    How can I replace newScale text strings with custom values?
    All  newScale text is customizable. Follow the procedure below to change the  value of any text string that appears in RequestCenter online pages.
    Procedure
    1. Find out the String ID of the text string you would like to overwrite by turning on the String ID display:
    a) Navigate to the RequestCenter.ear/config directory.
    b) Open the newscale.properties file and add the following name-value pair at the end of the file:res.format=2
    c) Save the file.
    d) Repeat steps b and c for the RmiConfig.prop and RequestCenter.prop files.
    e) Stop and restart the RequestCenter service.
    f) Log  in to RequestCenter and browse to the page that has the text you want  to overwrite. In front of the text you will now see the String ID.
    g) Note down the String ID's you want to change.
    2. Navigate to the directory: /RequestCenter.ear/RequestCenter.war/WEB-INF/classes/com/newscale/bfw.
    3. Create the following sub-directory: res/resources
    4. Create the following empty text files in the directory you just created:
    RequestCenter_0.properties
    RequestCenter_1.properties
    RequestCenter_2.properties
    RequestCenter_3.properties
    RequestCenter_4.properties
    RequestCenter_5.properties
    RequestCenter_6.properties
    RequestCenter_7.properties
    5. Add the custom text strings to the appropriate  RequestCenter_<Number>.properties file in the following manner  (name-value pair) StringID=YourCustomTextString
    Example: The StringID for "Available Work" in ServiceManager is 699.
    If you wanted to change "Available Work" to "General Inbox", you  would add the following line to the RequestCenter_0.properties file
         699=General Inbox
    Strings are divided into the following files, based on their numeric ID:
    Strings are divided into the following files, based on their numeric ID:
    String ID  File Name
    0 to 999 -> RequestCenter_0.properties
    1000 to 1999 -> RequestCenter_1.properties
    2000 to 2999 -> RequestCenter_2.properties
    3000 to 3999 -> RequestCenter_3.properties
    4000 to 4999 -> RequestCenter_4.properties
    5000 to 5999 -> RequestCenter_5.properties
    6000 to 6999 -> RequestCenter_6.properties
    7000 to 7999 -> RequestCenter_7.properties
    6. Turn off the String ID display by removing (or commenting out) the line "res.format=2" from the newscale.properties, RequestCenter.prop and RmiConfig.prop files
    7. Restart RequestCenter.
    Your customized text should be displayed.

    I've recently come across this information and it was very helpful in changing some of the inline text.
    However, one place that seemed out of reach with this method was the three main buttons on an "Order" page.  Specifically the "Add & Review Order" button was confusing some of our users.
    Through the use of JavaScript we were able to modify the label of this button.  We placed JS in the footer.html file that changes the value of the butt

  • Writing a text string in a table

    Right now the current piece of script is
    document.body.insertBefore(oAddLink, document.StockForm);
    and that writes the text string inside the form. Well I need
    to write it inside a table but the table doesn't have a name so how
    could I do that?

    TGuthrie wrote:
    > Right now the current piece of script is
    > document.body.insertBefore(oAddLink,
    document.StockForm);
    > and that writes the text string inside the form. Well I
    need to write it
    > inside a table but the table doesn't have a name so how
    could I do that?
    >
    I would give the <td> in which you want to place the
    link an id
    document.getElementById("yourID").innerHTML=oAddLink;
    Mick

  • Operations on text strings

    Hi experts,
          I have a situation wherein i have to compare the text strings and if it matches i want to copy the below lines to an internal table until it faces some other keyword. Let me explain in detail, I have an internal table like this,
    summary
        xxxxxx
        yyyyyyy
        zzzzzzz
    project
        aaaaaa
        bbbbbb
        cccccc
        dddddd
    Now i want to search for summary in the above itab and i want to copy the contents under summary(3 lines here) to another internal table until it encounters project. And I want do same for project also. Pls help me.
    Points assured
    Regards
    Tharanatha

    !!! Check this code !!!
    TYPES : BEGIN OF ty_struct ,
              sv_string TYPE string,
            END OF ty_struct.
    DATA : itab_struct1 TYPE TABLE OF ty_struct,
           wa_struct1 LIKE LINE OF itab_struct1,
           itab_struct2 TYPE TABLE OF ty_struct,
           wa_struct2 LIKE LINE OF itab_struct2.
            wa_struct1-sv_string = 'efghijkl'.
            APPEND wa_struct1 to itab_struct1.
            wa_struct1-sv_string = 'hmgkdhfl'.
            APPEND wa_struct1 to itab_struct1.
            wa_struct1-sv_string = 'summary'.
            APPEND wa_struct1 to itab_struct1.
            wa_struct1-sv_string = 'xxxxxxx'.
            APPEND wa_struct1 to itab_struct1.
            wa_struct1-sv_string = 'yyyyyyy'.
            APPEND wa_struct1 to itab_struct1.
            wa_struct1-sv_string = 'zzzzzzz'.
            APPEND wa_struct1 to itab_struct1.
            wa_struct1-sv_string = 'project'.
            APPEND wa_struct1 to itab_struct1.
            wa_struct1-sv_string = 'aaaaaaa'.
            APPEND wa_struct1 to itab_struct1.
    DATA : lv_string1 TYPE string,
           lv_string2 like lv_string1,
           summary_index TYPE I,
           project_index TYPE I.
    lv_string1 = 'summary'.
    lv_string2 = 'project'.
    READ TABLE itab_struct1 INTO wa_struct1 WITH TABLE KEY sv_string = 'summary'.
    IF sy-subrc eq 0.
      summary_index = sy-tabix.
      summary_index = summary_index + 1.
    ENDIF.
    READ TABLE itab_struct1 INTO wa_struct1 WITH TABLE KEY sv_string = 'project'.
    IF sy-subrc eq 0.
      project_index = sy-tabix.
      project_index = project_index - 1.
    ENDIF.
            LOOP AT itab_struct1 INTO wa_struct1  FROM summary_index to project_index.
              APPEND wa_struct1 to itab_struct2.
            ENDLOOP.
            WRITE : 'Done'.
    <b>Reward Points If Useful</b>

  • Bridge CS3 -- Incorrect label text string appears

    I've successfully changed the text string for the labels on four of the five "color" labels by choosing Preferences/Labels.  The 5th label (red/6) shows the correct text I would like to use in the preferences window.  But when I when I right click on a photo and point to label, the incorrect text string appears as a choice, one that does not show up in the preferences/label window.  Same incorrect text string appears when I choose label in the Bridge task bar at the top of the screen.  And, if I do choose the incorrect text stringed label by right clicking or choose label, hoping that it will remember the correct text string appearing in preferences, the incorrect text string is used and appears to the left of the bridge window under label, when I am viewing in the default view mode.  HELP!  Thanks.

    The first thing to try is trashing your Bridge preferences by holding down the Option key as you launch Bridge.

  • NI 6343 Internal DI Sample Clock counter name text string?

    I need to add a frequency test to my remote site (remote debug). Could someone tell me the text string as counter name for NI 6343 Internal DI Sample Clock? Thanks. 

    Does your remote computer have MAX installed? This is the easiest way to see what the device alias is.
    You can always just try Dev1 and see if it works. This is the default when the very first device is added to a system.
    If you can deploy code to the remote system, you can also use the DevNames property of the System Node from the DAQmx System Setup palette. This will show you all of the names of the devices in the system and you should see your device there.

  • Finder failing to display text strings (screen shot)

    I just upgraded from Tiger to Leopard.
    My Finder menus and windows are not displaying the text strings from the Leopard text mapping.
    http://www.robabbott.com/go/share/findernotext.png
    The above image is the confirmation window when emptying the trash.
    Help!

    Hi thanks for the advice, the text is centred vertically , left aligned and there is plenty of space at the end. I will try increasing width/height but not sure if that will help as box is already much bigger than text.
    In fact it works perfectly on another web page ...thats what surprising ....even the html for the two pages is identical from what we can see!
    Take a look at
    www.cibsys.com/cibsys1/index.html on the UK site and run down the various pages on the left side to see what happens (if you have IE on a PC). On the PC on some pages perhaps 30% eg workflow services the menu on the left fails to draw correctly leaving the text un readable.
    Thanks

  • Difference in a string and the text retrieved from JTextBox

    Hello,
    I am facing a peculiar problem. Please see the following code fragment:
    m.replaceAll(";\ngo;);
    where m is a matcher. This is working fine. But whenever I am doing
    m.replaceAll(myTextBox.getText());
    and placing ";\ngo;" in the text Field is not working as before. This is because that getText() returns a string in text form(doesnot take the newline into consideration). Any idea how to solve this?
    Regards,
    Saurav

    Here is the following code:
    File fin = new File(file);
    File fout = new File("C:\\Temp\\temp123.txt");
    FileInputStream fis = new FileInputStream(fin);
    FileOutputStream fos = new FileOutputStream(fout);
    BufferedReader in = new BufferedReader(new InputStreamReader(fis));
    BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos));
    Pattern p = Pattern.compile(find);
    Matcher m = p.matcher("");
    String aLine = null;
    while((aLine = in.readLine()) != null) {
    m.reset(aLine);
    String result = m.replaceAll(replace);
    out.write(result);
    out.newLine();
    in.close();
    out.close();
    What I intend to do is that the user will provide a fileName from the GUI and also the text to find and the text to repalce with. Both of them will be in a JTextBox. Now
    suppose I want to replace ";" in the line "Hello;" with ";\nHow are u?" so that the line looks like
    "Hello;
    How are u?"
    But what is happening is that the line looks like
    "Hello;\nHow are u?" after replacement.
    This happens because getText() doesnot considers that as a special character...
    I tried to harcode the replace string and it worked perfectly....
    Thats the problem.....I need the same behaviour with getText().
    Regards,
    Saurav

  • Multi-language support for user-specified text strings used in the forms

    multi-language support for user-specified text strings used in the forms
    Instead of creating multiple forms, 1 in each different language, for the same service, is there any workaround?

    Hoan - is your question what are the considerations when creating multiligual catalogs? If so, I can tell you that at other clients I have seen them use a single catalog for one or two languages. For the two langugages, such as Spanish/English, you can create a single catalog with both of them. Once you get to more than two languages, the catalog would get unweildy and is therefore not suggested.

  • How to open a new window by clicking the string in the text field ?

    Hi
    is it possible to do this ?
    Some string value is retrieved from database and it is placed in the text field. [ done with this part ]
    i have to provide link to that string to open a new window. [ yet to do ]
    Please help me in this.
    Note : if this is not possible , give me some other idea to do this.
    -Arun

    whether this is useful ?
    I am using string field here.
    public StringField(java.lang.String name,
    java.lang.Object listener,
    java.lang.String callback,
    java.lang.String value)Constructs a StringField
    Parameters:
    name - Name of field
    listener - Listener to update
    callback - Callback of listener
    value - Value of field
    -Arun

  • Superscript just the "2" in a text string "m2"?

    Hi,
    I need to know how to change all occurrences of the text "m2" in an indesign CS3 document, to "m2", where the "2" is styled as superscript i.e. the symbol for metres squared (I'm on the right hand side of the Atlantic as you can see!).
    The text has already had a sequence of paragraph styles applied to it, therefore the "m2" occurrences throughout the document may be in several sizes and weights of a single font family, so any solutions would need to leave this formatting in place.
    I have experimented with using a character style with only one attribute (superscript) in the Change Format section of find/replace, but this then changes the "m" to superscript as well.
    Is this sort of thing outside the scope of Indesign's Find/Replace functionality?
    Any pointers or suggestions gratefully received.
    Best wishes,
    Christian.

    If you're working with CS3, there is a much slicker way to do just that.
    In GREP mode, search for "(?<=m)2". Put just Superscript in the replace field.
    Possible (!) explanation:
    (?<= ...) switches on Positive Lookbehind for the '...' part of the search string. That means that only the '2's will be found with a
    i preceding
    text '...'. Put 'm' in the place of the dots, and it'll find all '2's preceded by an 'm'. The 'm' itself is not touched.

Maybe you are looking for

  • TS3276 can receive and send email on ipad  and can send email from mac to ipad but cannot read emails on mac

    mac was set up with email account. now i am unable to read my emails, tried sending test email from mac to ipad and it worked sent email from ipad to mac but did not register why? when it use to work up until tuesday. checked email sever settings and

  • Once in a year tax

    dear all, if bonus is paid in a month. i need to calculate tax for that amount in that particular month. it should affect /460. which standard wage type should i copy. thanks. regards, sidharth

  • Internet Browser

    I usually use my MBP on a home network that has a TiBook as the only other computer. One of my important email accounts happens to be on Hotmail, which I can't check in Safari because MSN is weird. That, and some other site incompatibilities, are why

  • Updating cs4 to have camera raw 5.7

    updating cs4 to have camera raw 5.7 "installation encounters problem, please close adobe bridge", but adobe bridge is not open what should I do?

  • [Solved] Internet speed problems

    Hello. I noticed that my firefox is taking a long time "looking up" sites, even google, so that sites that have to do multiple lookups load extremely slowly. In windows it works fine. I thought it was a dns problem so i tried using opendns 208.67.222