How to read attributes in to datagrid?

hi
i have one doubt
in the datagrid we have header text but if we create dynamic datagrid
and for (eg)
<root>
<data>
<time datas="Hello">
<john  second="Karthikkkkkkkkk"></john>
</time>
</data>
</root>
if we want o make "datas" as header text what can we do
and below datas we need "second" as child
any idea
karthik.k

You can use labelFunction to get to datas.
If you need children, you might need to use Tree or AdvancedDataGrid
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

Similar Messages

  • ABAP: How to read attribute of characteristic

    Hello Folks.
    Imagine, I have a Characteristic called ABC, this Char in turns hat two attributes Z1 and Z2. While processing a ABAP-Class-based Planning Function, I want to read the value of these two attributes Z1 and Z2. How to achive this?
    Is there any Function Module to read the attribute values for a give characteristic? Or even better a ABAP-Class?!
    Thanks in advance

    see this document..for sample code..
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/p-r/performance%20optimization%20in%20bw%20update%20rules.doc
    this code is used in BW update rules..
    i think u can use similar code for ur requirement too..
    cheers,
    Vishvesh

  • How to read attributes of selected row in table?

    hi,
    can anyone give me a example, how to get value of currently selected row of af:table,in backingbeans? assuming using jdv10g & single selection in table.
    thanks & regards

    in the table selectionlistener
            BindingContainer bindings = getBindingsForDCB();
            RichTable table=table1; 
            DCIteratorBinding outListIter = getBindingsForDCB().findIteratorBinding("yourtableIterator");
            RowKeySet rowSet = table.getSelectedRowKeys();
            Iterator rowKeySetIter = rowSet.iterator();
            while (rowKeySetIter.hasNext()) {
                    List l = (List) rowKeySetIter.next();
                    Key key = (Key)l.get(0);
                    outListIter.setCurrentRowWithKey(key.toStringFormat(true));   
                    Row r = outListIter.getCurrentRow();
          }

  • What is S.M.A.R.T. and how to read S.M.A.R.T. attributes

    Read the bottom for updated information/amendments
    Hi everyone,
    S.M.A.R.T. is Self-Monitoring, Analysis and Reporting Technology.
    [size=15]1. S.M.A.R.T. info websites[/size]
    OK, now we all know what S.M.A.R.T. stands for. For more details about S.M.A.R.T., here is a comprehensive non-technical explanation about S.M.A.R.T. by pcguide.com. Maxtor has published a white paper on S.M.A.R.T. too. And this is from Seagate. Anyhow, I am not going to discuss whether S.M.A.R.T will protect your harddisk from failure, etc etc here. Let us focus more on S.M.A.R.T. itself.
    [size=15]2. S.M.A.R.T. monitoring tools[/size]
    S.M.A.R.T. data is stored as a tabulated data somewhere in the harddisk as registers. The tools below support reading these registers value from S.M.A.R.T. enabled harddisk.
    1. SpeedFan *sign-up is required for download, but it's FREE
    2. Active SMART
    3. Sisoftware SANDRA 2002.6.8.97 SP1 , older version doesn't support
    [size=15]3. S.M.A.R.T. Tabulated Information[/size]
    Here is a screenshot captured with SpeedFan.
    Let us go through the screenshot. As can be seen, there are 5 columns - Attribute, Value, Worst, Warn and Raw.
    Attribute
    describes the meaning of the values. As mentioned above, the SMART data is stored as a tabulated data as registers. Each attribute represents one register ID. eg Raw Read Error Rate is register ID 01, register ID 03 is Spin-up Time, etc.
    Note that the register IDs are not displayed by SpeedFan, but are displayed by other SANDRA and Active SMART. I have no idea how many S.M.A.R.T. attributes are there, Active SMART stated it can detect more than 35 attributes!
    However, some attributes are manufacturer specific. So possibly some attribute names as shown in these SMART tools might not represent the true meaning of the values too!!
    Value
    is the current relative value of the attribute read from the registers.
    Worst
    is the worst value ever achieved.
    Warn
    is the critical threshold value of the attribute. If the Value has reached and OVER this threshold value, with very high probability the harddisk is in trouble. If SMART is enabled in the BIOS, SMART will alert user in the POST screen, with some manufacturer specific error code. You may need to refer to your manufacturer then.
    Note : Value, Worst and Warn are all relative values, such as percentage, not actual count. I have no idea how to calculate these values. This is the very S.M.A.R.T. algorithm, isn't it? ?(
    Raw
    is in fact, the most understandable represented value here! It represents the actual count of the attribute. SpeedFan displays this raw value as hexadecimal numbers. Such as Power On Hours Count is "AA8", which is 2728 in decimal numbers, meaning that the harddisk has been power on for 2728 hours!! There are some Raws represent average rate, such as "CRC Error Rate" etc.
    [size=15]4. S.M.A.R.T. Attributes In Detail[/size]
    Hopefully by now, you have the basic idea how to read the tabulated data. I will try my best to go through the attributes one-by-one, which after that shall make you understand more about S.M.A.R.T. and of course, starts to appreciate it.
    Raw Read Error Rate represents the condition of the physical disk, based on raw (physical) read errors, and physical surface defects.
    Spin Up Time is the time taken for the hdd to spin-up. more info
    Start/Stop Count is the number of counts (cycles) the hdd start/stop. more info
    Reallocated Sector Count - the number of sectors have been reallocated. Surface scan and found bad sector will increase this count. Now this drive has 7 bad sectors already!
    Seek Error Rate - how often the drive failed to locate the data (seeking)
    Power On Hours Count - the number of hours you have powered on the HDD.
    Spin Retry Count - how many time your drive need to attempt to get the drive platter spinning. If this value is more than 1, your drive is seriously in very bad condition!
    Calibration Retry Count - represents the number of time your drive perform calibration retry. I am not sure if low-level format would increase this value.
    Power Cycle CountThe number of time the hdd has been powered on. On and Off = 1 cycle.
    Read Soft Error Rate - should be Soft Read Error Rate. Similar to Raw Read Error Rate but this one depends on logical level, such as error occured in the hdd buffer, etc.
    Temperature - The drive temperature, Forget the relative values, read from the Raw value -- "2D" in this example, which is 45C. But my SpeedFan displayed 47C at that time!! SpeedFan seems to produce some +-2C error from actual reading once in a while. :P
    Hardware ECC Recovered is the number of counts ECC correction is performed on the data.
    Reallocated Event Count - similar to Reallocated Sector Count but this one is on the data.
    Current Pending Sector - is the number of counts how many sectors are currently pending. But what is a pending sector?? ?( ?(
    Offline Correctable - which is Off-line Scan Uncorrectable Sector Count. Again, what is off-line scan?
    UltraATA CRC Error Rate - which is in fact, CRC Error Count instead of rate. As shown, there have been "3C3", which is 883 errors occured already!!!
    There are more S.M.A.R.T. attributes, such as
    Thoroughput Performance - again, this relative value is surely got from some wierd algorithm again.
    Seek Time Performance - some algorithm has been used to calculate this performance value.
    Power Off Retract and Load Cycle Count are IBM HDD specific features -- unload the head off the platters when power off. More info on Head Load/unload cycle.
    [size=15]5. SpeedFan S.M.A.R.T. Fitness and Performance bars[/size]
    I should not comment on this too much because this is Almico's work. I am not sure how he calculate to define the "fitness" and "performance" though. It could probably based on mathematic relation between the current Values  and the threshold Warns.  
    For most hdds, like Maxtor and Seagate's, out-of-the-box the fitness bar has already reaching half-way 50%. But for IBM hdd, the fitness bar is always around 100%. This is because IBM hdd has its threshold/Warn values set to unrealistically high until it's quite unreachable even after a long term use. While for other brand HDDs, the threshold values are more realistic. Thus, the fitness bar in particular, does not tell the true fitness of the HDD. Take it as a reference only. Please always refer back to the Raw values to determine the fitness.
    [size=15]6. Conclusion : Judging HDD fitness by our own selves![/size]
    Now we all know what the Attributes are, so roughly everyone will have the basic idea how to judge HDD health by our own selves depend on the attributes you're reading. S.M.A.R.T. itself however, define "fitness" and "performance" based on its own algorithm.
    We can categorize the attributes into :
    Error Related Attributes
    "UltraATA CRC Error Rate", "Raw Read Error Rate", "Raw Soft Error Rate", "Hardware ECC Recovered Count", "Reallocated Sector Count", "Reallocated Event/Data Count", Offline Correctable"
    -- tell how often are those errors occured. For the above example, this Maxtor harddisk should be RMA-ed for its high CRC Error Rate count.
    Drive Fitness Attributes
    Spin Up Time, Start/Stop Count, Seek Error Rate, Power On Hours Count, Spin Retry Count, Calibration Retry Count, Power Cycle Count, Power Off Retract Count, Load Cycle Count
    -- check "spin retry count" and "Seek Error Rate", any value other than zero is really bad.
    Other Attributes
    I have no idea what they are for except Temperature.
    As the conclusion, understanding S.M.A.R.T. attributes helps in knowing your HDD fitness by your own self, rather than waiting for the S.M.A.R.T. to alert you for severe error. That might be too late already.  8o
    Thanks for reading.
    Edited:
    1. for better reading pleasure
    2. added Conclusion
    3. added explanations about SpeedFan SMART Fitness and Performance bar.

    Quote
    Originally posted by WarLord
    I like this HD tool. i use it everyday now. the tempture readings are great Hd temp cpu temp and even the system temp nice added feature to the monitoring. And this is an alternative to enabling the SMART in the bios? Thats the way im understanding it. is that right Maesus ?Because i have disabled in bios. She went threw alot of trouble here. thank you  
    Well from my observation, whether SMART is disabled or enabled in the BIOS, SMART is always working within the HDD itself.
    Basically SMART is acting like a blackbox, monitoring and tabulating HDD condition from time to time and its attributes only fully revealable by the manufacturers. SpeedFan's SMART status only displays partial information that is displayable. Some attributes are hidden, ~OR~ the attributes' locations are different from one HDD to another brand, such that some values don't correspond to the attribute meaning at all.
    It is very doubtful to claim that enabling SMART in the BIOS will hog down the performance. Just like a transport bus (yeah real bus that fetch passenger :P ), with or without the black box installed can't help it if the driver wants to speeding. :P

  • How to read an attribute of an xml tag in jsp.

    hi guys,
    This is murali krishna. i have a small problem,
    i have one xml file (books.xml)
    <?xml version="1.0" encoding="iso-8859-1"?>
    <library>
    <book id="1">
    <name>Head First Java, 2nd Edition</name>
    <author>Kathy Sierra and Bert Bates</author>
    <publication-date>09-Feb-2005</publication-date>
    </book>
    <book id="2">
    <name>Effective Java</name>
    <author>Joshua Bloch</author>
    <publication-date>28-May-2008</publication-date>
    </book>
    <book id="3">
    <name>Java How to Program, 7th Edition</name>
    <author>Harvey M. Deitel and Paul J. Deitel</author>
    <publication-date>6-Jan-2007</publication-date>
    </book>
    </library>
    I tried to read this xml file in jsp as shown below
    <%@ page language="java" %>
    <%@ page import="org.w3c.dom.*" %>
    <%@ page import="javax.xml.parsers.DocumentBuilder" %>
    <%@ page import="javax.xml.parsers.DocumentBuilderFactory" %>
    <%
    DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
    DocumentBuilder db =dbf.newDocumentBuilder();
    Document doc=db.parse("c:\\books.xml");
    NodeList nl = doc.getElementsByTagName("book");
    %>
    <html>
    <head>
    <title>How to read XML file in JAVA</title>
    </head>
    <body>
    <%
    for(int i=0;i<nl.getLength();i++)
    NodeList nameNlc= doc.getElementsByTagName("name");
    Element nameElements=(Element)nameNlc.item(i);
    String nameTagValue=nameElements.getChildNodes().item(0).getNodeValue();
    NodeList authorNlc= doc.getElementsByTagName("author");
    Element authorElements=(Element)authorNlc.item(i);
    String authorTagValue=authorElements.getChildNodes().item(0).getNodeValue();
    NodeList dateNlc= doc.getElementsByTagName("publication-date");
    Element dateElements=(Element)dateNlc.item(i);
    String dateTagValue=dateElements.getChildNodes().item(0).getNodeValue();
    out.println("name :"+nameTagValue+"<br>");
    out.println("author :"+authorTagValue+"<br>");
    out.println("publication-date :"+dateTagValue+"<br><br>");
    %>
    </body>
    </html>
    so, my problem is I was unable to read the attribute of the tag book , that is "id".
    can any one tell me how to read this "id" attribute.
    Murali Krishna
    [email protected]

    hi,
    U r retriving the elements by tag name.So it just chks the tag name ie.<book> & gives u array of elements.But u need retrive d attribute of <book> tag itself.
    =Solution =====
    Add one more statement ----> var[]= doc.getElementsByName("book");
    Now u hav book elements as an array & can retrive id in for loop
    for(var; var.length;var++)
    doc.element[var].id.value

  • How to read context node/attribute data of diff UI component of same screen

    Hi,
    I am new to CRM and as well as BSP, Now the requirement is, at the time of Lead creation, when the end user enters customer code and sales area i need to fetch and display the customer group 1 value( VIP,KAM etc) based on the customer's sales area, ( these are sales area specific values).
    but the problem is Customer code is in diff UI component and sales area data is in diff UI component .
    1) customer code attribute is in UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTPARTNERPROSPECT.
    2) sales area fields are in the UI component BTORGSET, View BTORGSET\OrgSetData, Context node is BTORGSET.
    3) I have created new field(customer type to display the customer group 1 value "VIP") in UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTLEADH.    
    To display the value in the context node BTLEADH, i need to know the sales area data which is entered in BTORGSET.
    Kindly let me know how to read the data which is in diff UI component of the same Lead creation screen.
    i written following code in context node BTLEADH, atttribute New Zfield, in get method, but not able solve, please guide me.
      DATA: LR_ENT TYPE REF TO CL_CRM_BOL_ENTITY,
                 LR_COL TYPE REF TO IF_BOL_ENTITY_COL.
      LR_ENT ?= ME->TYPED_CONTEXT->BuilHeader->COLLECTION_WRAPPER->GET_CURRENT( ).
      LR_COL = LR_ENT->GET_RELATED_ENTITIES( IV_RELATION_NAME = 'BuilSalesArrangementRel' ).
      LR_ENT ?= LR_COL->GET_FIRST( ).
      IF LR_ENT IS BOUND.
        LR_ENT->GET_PROPERTY_AS_VALUE( EXPORTING IV_ATTR_NAME = 'DIVISION'  IMPORTING EV_RESULT =  LV_DIVISION  ).
      ENDIF.
    I'll appreciate if you can provide me some documents to refer.
    awaiting for your responses.
    Thanks
    Bhanu

    Hi Gangadhar,
    I think i have not clearly explained my requirement, let me put it once again. My requirement is, I have to read two UI component data, validate and display some value in one new zfield which is in one of the UI components.
    I need to display customer's sales area specific data like customer group 1 value in that new zfield. for that i need Customer code and as well as sales area data from the screen.
    1) customer code attribute is in UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTPARTNERPROSPECT.
    2) sales area fields are in the UI component BTORGSET, View BTORGSET\OrgSetData, Context node is BTORGSET.
    3) I have created new field(customer type to display the customer group 1 value "VIP") in UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTLEADH.
    As per my understanding, in the context node BTLEADH, GET_METHOD of atttribute New Zfield, i have to read customer code from UI component BT108H_LEA, View BT108H_LEA\Detail, Context node is BTPARTNERPROSPECT and Sales area data from UI component BTORGSET, View BTORGSET\OrgSetData, Context node is BTORGSET based on the values, validate and display the data.
    But as per your recent reply you are asking me to write the code in get_property_attribute---division. so i didnt understand.
    Kindly clarify if i am wrong.
    awaiting for your response.
    Thanks
    BHanu

  • BOL: How to read the value of an attribut

    Hiii experts,
    I'm new in ABAP programming.
    My intention is to read the value of a context attribut.
    This attribut ist not in form of a struct attribut. To read an struct attribut, I know to get the value, for example:
    value ?= me->typed_context->BP_ADDR->collection_wrapper->get_current( ).
      CHECK value IS BOUND.
      value->get_property_as_value(
        EXPORTING
          iv_attr_name = 'CITY'
        IMPORTING
          ev_result    = value_city).
    But my problem is, that I have an attribut, which you can not find in the BOL browser, because it is not in form of a struct.
    Can anybody help me, how to read the value of this kind of attributs.
    Thank you very much in advance fpr your help,
    John

    Hii Clemens,
    first of all, my concern deals with WebUI.
    I expect to read the value of an attribut. I know how to read the value of an attribut, which can be found with the same description in the bol browser, as you know you can read it with:
    value ?= me->typed_context->BP_ADDR->collection_wrapper->get_current( ).
      CHECK value IS BOUND.
      value->get_property_as_value(
        EXPORTING
          iv_attr_name = 'CITY'
        IMPORTING
          ev_result    = value_city).
    Now, I have an attribut of an context node which has a different name as in bol browser. If I want to read the value with the code above I get an error message. Thatswhy I referenced a collection of the context node to read this attribut.
    Can anybody say me how the value of the attribut, can I use the methode get_property ?
    greetings,
    J

  • How to read the attribute in another context node from setter method

    Hi,
    As part of the  requirement
    i need to read the STRUCT.E_MAIL ( attribute ) present  in  INDEPENDANTEMAIL context node  from  the SET_S_SRUCT method of the context node  HEADER.
    I tried th following but it didnt work out....
    Get the Custom Controller Path
    *lr_cuco ?= controller->get_custom_controller( controller_id = 'BP_HEAD/IndComm').
    *IF lr_cuco IS BOUND.
    Get the Entity
    *lr_entity ?= lr_cuco->typed_context->independantemail->collection_wrapper->get_current( ).
    *ENDIF.
    *CHECK lr_entity IS BOUND.
    Get the Trade Event Type.
    *lv_email  = lr_entity->get_property_as_string( 'E_MAIL' ).
    also i tried ...
    data:
    *lv_value type string,
    *lr_property type ref to if_bol_bo_property_access.
    *lr_property = collection_wrapper->get_current( ).
    *lv_value = lr_property->GET_PROPERTY_AS_STRING( importing iv_attr_name = 'E_MAIL'
                                                returining  ev_result    = lv_email ).
    but it didnt workout ......
    Any suggestions   ...................
    Regards,
    Sijo...

    Hi,
    Both Context node are available in view then refer this link.
    Reading Attributes from different context nodes in the same view
    Relationship name for context node INDEPENDENTMAIL is 'BuilIndependantEmailRel'
    Regards
    Gaurav

  • How to read in a file and change the column attributes

    Hi,
    I'm new to java and i'm stuggling to find a way to read in a text file and perform calculations on the data, such as to normalise it.
    What in want to do is normalise the data by finding the greatest value in a column and then divide all the other values in the column with that value.
    I know how to read a file in and store each line in a vector but for this problem i think i need to store each column in an array, but i'm not sure how to do this.
    Can anyone help please?
    Thanks

    Hi,
    I'm new to java and i'm stuggling to find a way to
    read in a text file and perform calculations on the
    data, such as to normalise it.
    What in want to do is normalise the data by finding
    the greatest value in a column and then divide all
    the other values in the column with that value.
    I know how to read a file in and store each line in a
    vector but for this problem i think i need to store
    each column in an array, but i'm not sure how to do
    this.
    Can anyone help please?
    ThanksI think this should work but I wrote it out without completely thinking about it (hopefully to get things started).
    So if you had this:
    age height earnings
    0 2 100
    1 3 50
    2 1 0
    For the age column you'd take 2 as the largest and then divide 0 and 1 by two to get 0, .5.
    First build up test files that seperate the columns in different ways. With spaces, tabs, and the ASCI Control character for null ( I think it's 0 ). Your program should detect
    numbers and spaces, tabs control character, commas and periods (for money). Because numbers don't have spaces it should be easy to keep track of which column
    you're in.
    Store each line into a 3D String array with each index containing a String built up from the chars scanned in on each line, when a blank area is found followed by another
    number iterate the column index. When you come to the end of the line set column == 0 and row+1.
    private String[][][] test = new String[2][6][1];
    20     3      11      14      44       0
    4      5       7      80      91      49
    test[0][0][0] would be row 1 col 1 value 1 ((20))
    test[0][1][0] would be r1, c2, v1 ((3))
    test[1][0][0] would be r2, c1, v1 ((4))
    test[1][2][0] would be r2, c3, v1 ((7))
    test[1][5][0] would be r2, c6, v1 ((49))
    package source.Final;
    import javax.swing.*;
    import java.io.*;
    public class S7
         public static void main(String[] args)
              getContents();
              System.exit(0);
         public static void getContents()
              String lineSep = System.getProperty("line.separator");
              char c = ' ';
              int iterator = 0;
              int i = 0;
              int charNum = 1;
              int lineCount = 1;
             //declared here only to make visible to finally clause
             BufferedReader input = null;
             BufferedWriter out = null;
             try {
                         String line = null;
                          * This implementation reads / writes one line at a time
                          * using the buffered reader / writer Java classes.
                         input = new BufferedReader( new FileReader( "C:\\Scan file test\\Read\\test1.txt" ));
                           out = new BufferedWriter( new FileWriter( "C:\\Scan file test\\Read\\test2.txt" ));
                         //input = new BufferedReader( new FileReader( "C:\\Scan file test\\Read\\booked_policies1.txt" ));
                           //out = new BufferedWriter( new FileWriter( "C:\\Scan file test\\Write\\booked_policies1.txt" ));
                         //input = new BufferedReader( new FileReader( "C:\\Scan file test\\Read\\booked_policies2.txt" ));
                           //out = new BufferedWriter( new FileWriter( "C:\\Scan file test\\Write\\booked_policies2.txt" ));
                         //input = new BufferedReader( new FileReader( "C:\\Scan file test\\Read\\booked_policies3.txt" ));
                           //out = new BufferedWriter( new FileWriter( "C:\\Scan file test\\Write\\booked_policies3.txt" ));
                         out.write( "Character\tLine Number\tCharacter Number\tAscii Value" + lineSep );                     
                              while (( line = input.readLine()) != null)
                              i = 0;
                              charNum = 1;
                              iterator = 0;
                              while( i < line.length() )
                                               c = line.charAt(iterator);                                             
                                            if( (int)c == 0 || (int)c == 9 )
                                                 break;
                                            else if( c >= '[' && c <= '_')
                                                 {out.write( "["+c+"]\t\t"+"["+lineCount+"]\t\t"+"["+charNum+"]\t\t\t"+"["+(int)(c)+"]"+lineSep );}
                                            else if( c <  ' ' )// && (int)c != 0 && (int)c != 9  )
                                                 {out.write( "["+c+"]\t\t"+"["+lineCount+"]\t\t"+"["+charNum+"]\t\t\t"+"["+(int)(c)+"]"+lineSep );}
                                            else if( c >  ';' && c <= '@' && c != '=')
                                                 {out.write( "["+c+"]\t\t"+"["+lineCount+"]\t\t"+"["+charNum+"]\t\t\t"+"["+(int)(c)+"]"+lineSep );}
                                            else if( c >= '!' && c < '"' )
                                                 {out.write( "["+c+"]\t\t"+"["+lineCount+"]\t\t"+"["+charNum+"]\t\t\t"+"["+(int)(c)+"]"+lineSep );}
                                            else if( c >  'z' && c < '~' )
                                                 {out.write( "["+c+"]\t\t"+"["+lineCount+"]\t\t"+"["+charNum+"]\t\t\t"+"["+(int)(c)+"]"+lineSep );}
                                            else if( c == '%' )
                                                 {out.write( "["+c+"]\t\t"+"["+lineCount+"]\t\t"+"["+charNum+"]\t\t\t"+"["+(int)(c)+"]"+lineSep );}
                                            else if( c >  '~' )
                                                 {out.write( "["+c+"]\t\t"+"["+lineCount+"]\t\t"+"["+charNum+"]\t\t\t"+"["+(int)(c)+"]"+lineSep );}
                                            charNum += 1;
                                               iterator += 1;
                                               i++;
                                    lineCount += 1;
             catch (FileNotFoundException ex) {ex.printStackTrace();     System.out.println("File not found.");}
                 catch (IOException ex){ex.printStackTrace();               System.out.println("IO Error.");}
             finally{ try{ if( input != null ) input.close();                if( out != null ) out.close();}
                    catch (IOException ex){ex.printStackTrace();        System.out.println("IO Error #2.");}
        }

  • How to read the content in one node of XML in Java? Pls help

    My dear brothers,
    I am a newbie of XML, I have a exercise which is creating a Tree View from XML file. But the trouble is I do not know how to read the content in one node of XML file. I decide to use the algorithm as following:
    1. Create a GUI form which gives the ability for user to choose a XML file (ok)
    2. Load XML and return the file (ok)
    3. Read the file from node to node to create the node in Tree View (?!)
    Please help me, and if you are enough kind, please give me an small example to easy understand. Thanks in advance.
    Hoang Yen Binh

    I hope this one helps you.
         <ABC Type="ProductBased" ProdName="One" Location="India">
              <CEO>Raj</CEO>
              <Finance>Vikram</Finance>
              <HR>Karthik</HR>
              <Technical>Satish</Technical>
         </ABC>
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NamedNodeMap;
    import org.w3c.dom.Attr;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Node;
    import org.w3c.dom.DOMException;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import java.io.File;
    import java.io.IOException;
    public class XmlReading {
         Document doc;
         Element element;
         public static void main(String[] args) throws Exception{
              XmlReading xr = new XmlReading();
              xr.getXmlParser(args);
         public void getXmlParser(String[] args) {
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   if(args.length != 1) {
                        System.err.println("Argument Required");
              try {
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   doc = builder.parse(new File(args[0]));
              }catch(ParserConfigurationException e1) {
              }catch(SAXException e2) {
              }catch(IOException e3) {
              getAttributes();
         public void getAttributes() {
              // Retrive the entire Document from the Dom Tree
              element = doc.getDocumentElement();
    //          System.out.println(element);
              NamedNodeMap attrs = element.getAttributes();
              // Get number of attributes in the element
         int numAttrs = attrs.getLength();
         // Process each attribute
              for (int i=0; i<numAttrs; i++) {
                   Node node = attrs.item(i);
                   // Get attribute name and value
                   String attrName = node.getNodeName();
                   String attrValue = node.getNodeValue();
                   System.out.println(attrName + ": " + attrValue);
              String s1 = element.getTagName();
              System.out.println(s1);
              // To get all the elements in a DOM Tree
              NodeList nl1 = element.getElementsByTagName("*");
              int i2 = nl1.getLength();
              System.out.println(i2);
              for(int i=0; i<i2; i++) {
                   System.out.println(nl1.item(i) + "\n");
    }

  • How can I attribute my edits before aperture to the raw files as versions?

    Hi,
    I am in the middle of importing all my files (approx 100,000) into aperture. I have previously made edits of my best images and in some cases have several edits for one 'master' file. How can I attribute or link the edits to the master files? I have followed a simple nomenclature, where the camera raw file was say bfes1001.tif, I would name the files bfes1001e1.psd or bfes10001e1-small.jpg, bfes1001e1-epson7600.psd. So my question is really two parts, first is there a way to link my old edits to the master raw files, and secondly is there a way to import photoshop files without flattening them? I can't image throwing away all that time making masks etc. If there is no way to import a layered photoshop file then is there a way to make an association to the files if I leave them outside of Aperture (althought that seems to defeat a big part of Aperture)?
    Thanks,
    Eric

    This is not a method suited to automation, but what you can do is:
    1) Import original RAW into Aperture.
    2) Edit in external editor - it creates a new version based on PSD or TIFF (you choose in options).
    3) Kill external editor, replace created TIFF file with your new "master" tiff (or PSD). To do this just open the Aperture Library package using "Show Package Contents" in finder, do the same for the Project package held within the library, and finding the new TIFF version of your file. You could either replace the TIFF file before you return to Aperture form the editor or replace all the TIFF files with Aperture closed. The name must be identical. If you have a TIFF or PSD not in RGB mode Aperture will not like you much and probably crash whenever you go to view the picture.
    That seems the most space-efficient way to me and keeps Aperture understanding that your edited TIFFS are versions of a particular master.

  • How to Read Variable Values in WAD 7.0 Using JavaScript

    I found a how to: How to Read Variable Values in WAD 7.0 Using JavaScript on SDN.
    I get a Javascript error:
    bics.getElementsByTagName is not a function
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    Thats my script:
    function currency()
    var varnm = "SFS_CP_CURR"; // Name of the variable to be read
    root = document.childNodes[0]; // <HTML>
    body = root.getElementsByTagName("BODY")[0]; // <BODY>
    xml = body.getElementsByTagName("XML")[0]; // <XML>
    bics = xml.childNodes[0]; // <BICS_VIEW>
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    varl = vars.getElementsByTagName("VARIABLE"); // gives no. of variable in DP
    for ( i = 0; i <= varl.length; i++ ) // Loop one by one
    vari = vars.getElementsByTagName("VARIABLE")<i>;
    varnam = vari.attributes[0].text; // get variable name
    mem = vari.getElementsByTagName("MEMBER")[0];
    varval = mem.attributes.getNamedItem("name").value; // read variable value
    if (varnam == varnm) //check varname in loop needs to be read
    if (varval == "ZMON") // check for value1 and fire command1
    SFS_CP_M();
    if (varval == "ZKON") // check for value2 and fire command2
    SFS_CP_K();
    break;
    Where's the mistake?

    I'm afraid I haven't made my question understood clearly.
    What I am looking for is a method to get the value of variable inside excel (e.g. put it into a cell / range of a worksheet, so that we can reference it and use it as an input for planning function execution).
    Please advice.
    Thanks in advance,
    Shady

  • How to read the complete path in file upload UI

    Hi,
    I want to know how to read the complete path in file upload UI in java web dynpro.
    I have created 1 file upload UI and than when i do browse and select some file say small.jpg from my local PC, desktop , its path is coming in file upload UI like E:\small.jpg,
    I want to know how to get this path in java webdynpro code.
    please let me know..

    Hi Satyam,
    In webdynpro java, first file stores in server location then it reads from server.
    Create a button with upload and write this code OnAction
    Resource is the attribute name in context of type com.sap.ide.webdynpro.uielementdefinitions.Resource, this attribute is for Resource property for Upload UI Element.
    Then in OnAction of button
    InputStream text = null;
           int temp=0;
           try{
                File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());
               String path = file.getAbsolutePath();
                wdComponentAPI.getMessageManager().reportSuccess(path);
           }catch(Exception e){
                e.printStackTrace();
        //@@end
    Regards,
    Pradeep
    Edited by: pradeep_546 on May 11, 2011 12:22 PM

  • How to tag attribute member with standard dimension member in EIS

    hi,
    would any one please help me how to tag attribute member with standard dimension member in EIS
    THANK U IN ADVANCE

    In your OLAP model, view columns for the base dimension table. Go into the column properties and for the columns that have Attribute values highlight them and click the Attribute button.
    Go into Metadata Model and those fields will be available to drag into your outline as attribute members.
    Once in the outline, go into the properties of the attribute and assign the level of the base dimension they associate with.

  • How to read an xml file from headers

    Hi ,
    I am not getting how to read an xml file sent by client device in header to server.
    Thankx.

    There is a getHeader() in HttpServletRequest interface
    String locationURL=request.getHeader("Location");If URL of your file was set in Location attribute of header.
    Edited by: ngpgeeta on Dec 19, 2008 8:03 AM

Maybe you are looking for

  • Purchase info record numbering

    Hi, I need to create purchase info record for a meterial. for that i have done the following. 1. Created purchase infor record numbering range and group. 2. But at the time of creating the purchase info record the number which displaying is not relat

  • Incoming file (with arabic in one field) to RFC ..file to RFC scenario

    Hi All, Below is a sample file comng form a ftp <?xml version="1.0" ?> - <catalog> - <book id="bk101">   <author>سليم</author>   <title>XML Developer's Guide</title>   <genre>Computer</genre>   <price>44.95</price>   <publish_date>2000-10-01</publish

  • I have 64 bit capablilty. Should my version of Premiere Pro and After Effect say "64 bit"?

    I am unable to download anything else. My choices do not include a 64 bit version.

  • A problem with message display

    Hi, I have an issue. We have a tcode ztcode whic uses the SAPMZSCH prg to create contract based sales orders. Also we r using VA02 to change normal sales orders. But the prb is when the creidt check is being done both prgms go through the same stm in

  • Looking for a hosting

    Hi all: I use several User defined table type for passing table values to some stored procedures I also use TVF I have 3 databases. I call 1 of them as databasename.dbo.table Do u know a hosting that allow all of this? Thanks in advanced