How to access attribute name (xml) in Servlet ?

Hi All,
Anybody please tell me how to access attribute name in servlet ?
Thanks

Parser.java
public class Parser
public static String getAtt()
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          factory.setNamespaceAware(true);
          DocumentBuilder parser = factory.newDocumentBuilder();
          Document doc = parser.parse("customer.xml");
          Element root = doc.getDocumentElement();
return root.getAttribute("name");
public static void main(String [] argc)
Parser p = new Parser();
p.getAtt();
Servlet.java
Parser p1 = new Parser();
String att1 = p1.getAtt();
Hope this will help u.
....yogesh

Similar Messages

  • How To Get Attribute Names for a Particular VO

    Hi ,
    How To Get Attribute Names Of a Vo where I can Set Viewattributname To the Table RN Columns Where I am Adding Extra Columns Based on Some Condn..
    So wen i am creating new Column to existing Table RN and we Need to add Attribute Name Also...Rt..
    And How To get RelationShip Between Database Column Name and Java Vo Attribute Name
    Ex: PlanId is the Java VO Attribute Name for the Database Column PLAN_ID
    In The Same way Hw We Get the Relation ship for All other columns In the Controller Cllass ..
    Can Any One Reply as It is urgent Req...
    Thanks ,,
    Jithen

    Instead of using the VO attribute names to set and get values, best to go to the VO definition, click on Java, and generate the View Row Class with the accessors.
    In the class where you're trying to set attributes, instead of a Row class, use the View Row class of your VO (eg ViewObjectName's class would be ViewObjectNameRowImpl), and when retrieving a row from the VO, cast the row to the previously mentioned View Row Class.
    At that point you can use the View Row Class's methods that would perform sets and gets of each column.
    To get attribute names, I don't know off the top of my head, but there might be a method mentioned in the Javadoc for the ViewRowImpl or ViewObject or ViewObjectDefinition classes to get the attribute/column mapping, or perhaps you can somehow read the XML definition of the VO which has that mapping.
    Assuming business components were built automatically and no attribute names were overridden, intuitively the attribute name is a camelcase version of the column name, removing understores and capitalizing the character following the removed underscore - but that's not a fool proof approach. Just a general observation.
    Hope this helps.
    Edited by: user6631964 on Sep 16, 2010 12:31 PM

  • How to access attribute

    Hi all,
       I am new to webdynpro for ABAP.  How to access the attribute which is directly under the root context.
    ex.
    Root Context
    |
       Name   ---> attribute.
    Regards,
    Gnid.

    Hi Gopi,
    Accessing a context element or a context attribute requires to first have a  reference to the related context node. The context root node can be accessed by the standard attribute WD_CONTEXT. 
    To Access a Node Element: After having accessed a context node, the reference to the element at lead selection  of this node can be obtained by calling the method get_element( ). Thismethod  returns a reference to the element instance of type IF_WD_CONTEXT_ELEMENT. Accessing the Node Element at Lead Selection  The element with index n can be accessed using the method get_element( index  = n ) .
    Once we access the element we can access the attribute by GET_ATTRIBUTE().
    Child nodes of the context root node can be identified using the get_child_node(  ) method. This method returns a reference to the node instance of type  IF_WD_CONTEXT_NODE. The get_child_node( ) method requires the name of  the node and, optionally, the index of the element in the parent node to which the  desired node instance belongs. In this case, the parent node is the context root,  which only ever has one element; therefore, the index parameter is 1 (default =  lead selection of parent element).
    Best regards,
    Suresh
    Message was edited by:
            Suresh Honnappanavar

  • How to retrieve attribute-names (not values)

    Hi
    I know that I can get all attributes by an XPath expression according to /AA/@* . But since I have a XML document in XMLType and when I use the "..extract( aXpath)" function, I get all the attributes of the corresponding node but as a concatenation of the values. How can I get the attributes names:
    E.G.
    AA
    BB 12.3 /BB
    CC 45.5 /CC
    /AA
    /AA/@* would return 12.345.5, but I need to know "BB" and "CC", any ideas ?

    ${applicationScope.abc}
    or if there is no attribute "abc" in page, request, or session scopes just
    ${abc}

  • How to access attribute in its owner method?

    var group : Group = Group{
    content: for(i in [0..10])
    for(j in [0..10])
    Rectangle{
    x:20
    onMouseClicked: function( e: MouseEvent ):Void {
    var xc = x // why can't access here x???? How to access?
    insert
    Line {
    startX: x//How to access x attribute from rectangle??
    startY: y //How to access y attribute from rectangle??
    endX: x+gap
    endY: y+gap
    strokeWidth: 1
    stroke: Color.BLACK
    into stage.scene.content
    };

    You can define global variables by using a public variable on script-level. Just make sure you define it outside of any class definition. For example if you want to define a global environment, you can create a script Environment.fx and put there your global variables:
    public var GLOBAL_VAR1 = 42;You can access this variable from anywhere with:
    Environment.GLOBAL_VAR1 = ...

  • How to show Attribute name in Single line in ADF-JSPX pages

    Hi,
    I am having a issue , attribute name like "Name Of Catalog" in Brazilian-Portuguese Lang. is displaying in two lines instead of showing in one line, but it is correctly showing in English language.
    And also this issue reproducible on IE 7 browser only. Please let me know your comments on above issue.
    Thanks
    Chandrakant

    Hi John,
    I have seen some solutions like using horizontal layout, where child components are arranged in a horizontal line. No wrapping is provided when contents exceed the amount of browser space available. Is this OK to use?
    One more question is, how to enable Portuguese - Brazil Lang for pages in Jdev ? in other words, I want to see Label Text in Portuguese - Brazil Lang instead of English ?
    Thanks.
    Chandrakant

  • How to access the Name label tag of a layer.

    Hello I need to access the Name Label of the Action layer in a movieClip with AC3.

    movieclips have a currentFrameLabel string property, a currentLabel string property (the current or previous labeled frame) and a currentLabels array property.

  • How to retrieve information from XML using servlets

    Hi
    I have a scenario like this
    File-->XI-->J2ee application(HTTP Receiver adapter)
    I want to know how XI sends xml file as a query string file name?
    What ever may be the case i just need to retrieve the information from Request object and display the same in browser(JSP).How to do that, I am totally confused, please anyone help me!
    Code help is highly rewarded.
    Thanx

    Hi Rajesh!
    I have tried your code. But some where i went wrong. Please correct me: I am using NWDS2.0.9
    my web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
                             "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
        <display-name>WEB APP</display-name>
        <description>WEB APP description</description>
        <servlet>
            <servlet-name>DisplayRes</servlet-name>
            <servlet-class>com.quinnox.DisplayRes</servlet-class>
        </servlet>
        <servlet-mapping>
              <servlet-name>DisplayRes</servlet-name>
              <url-pattern>/DisplayRes/*</url-pattern>
         </servlet-mapping>
    </web-app>
    my application.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
                                 "http://java.sun.com/dtd/application_1_3.dtd">
    <application>
        <display-name>ReceiverEntpr</display-name>
        <description>EAR description</description>
        <module>
            <web>
                <web-uri>HttpReceiver.war</web-uri>
                <context-root>/HttpReceiver</context-root>
            </web>
        </module>
    </application>
    and my servlet code:
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import java.io.Writer;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Result;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.xml.sax.EntityResolver;
    import org.xml.sax.SAXException;
    import com.sun.java_cup.internal.parser;
    import com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl;
    public class DisplayRes extends HttpServlet {
         public void doGet(HttpServletRequest requset, HttpServletResponse response) throws ServletException, IOException
              doWork(requset, response);
         public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
              doWork(req, resp);
         private void doWork(HttpServletRequest req, HttpServletResponse resp) throws IOException
              String path = null;
              PrintWriter out = null;
              PrintWriter p2=resp.getWriter();     
              try
                   resp.setContentType("text/xml");
                   out = resp.getWriter();
                   out.println("hi");
                   path = req.getPathInfo();
                   if(req.getContentLength() != -1){
                   outputURI(req.getInputStream(), out);
              } catch (IOException ioe) {     return;     
         //private void outputURI(InputStream resultStream, Writer out) {
              private void outputURI(InputStream resultStream, PrintWriter out) {
              if (resultStream == null) {
    //             no default file
    //            logger.error("No File to return");
              return;
              try {
              DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    //            Class clazz = loader.loadClass("org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
    //            DocumentBuilderFactoryImpl factory = (DocumentBuilderFactoryImpl) clazz.newInstance();
    //            DocumentBuilder parser = factory.newDocumentBuilder();
              parser.setEntityResolver(new ClassPathEntityResolver());
              printXML(parser.parse(resultStream), out);
              resultStream.close();
              } catch (Exception e) {
    //            logger.error("Trying to parse the output " , e);
         //private void printXML(Document document, Writer writer) throws Exception {
              private void printXML(Document document, PrintWriter writer) throws Exception {
              Transformer transformer = TransformerFactory.newInstance().newTransformer();
              Source source = new DOMSource(document);
              Result output = new StreamResult(System.out);
              transformer.transform(source, output);
    //             Write as XML so that entity references can be resolved.
              if (writer != null) {
              transformer.transform(source, new StreamResult(writer));
    Please tell me how to display in servlet.
    If it is better to display in a browser. Please send me the code.
    Thanks

  • How to get attribute from xml file

    I managed to grab all the info from xml, except the "url" attribute in <image type="poster" url="" size="mid" .../>. Any ideas?
    import java.io.*;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import java.net.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class XmlParser {
         ArrayList<Movie> myMovies;
         Document dom;
         public XmlParser(){
              //create a list to hold the movie objects
              myMovies = new ArrayList<Movie>();
         public void runExample(String adr, String tagName) {
              parseXmlFile(adr);
              parseDocument(tagName);
              printData();          
         private void parseXmlFile(String adr){
              //get the factory
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              try {               
                   //Using factory get an instance of document builder
                   DocumentBuilder db = dbf.newDocumentBuilder();
                   //parse using builder to get DOM representation of the XML file
                   URL xmlUrl = new URL(adr);
                   InputStream in = xmlUrl.openStream();
                   dom = db.parse(in);               
              }catch(ParserConfigurationException pce) {
                   pce.printStackTrace();
              }catch(SAXException se) {
                   se.printStackTrace();
              }catch(IOException ioe) {
                   ioe.printStackTrace();
         private void parseDocument(String tagName){
              //get the root elememt
              Element docEle = dom.getDocumentElement();
              //get a nodelist of <movie> elements
              NodeList nl = docEle.getElementsByTagName(tagName);
              if(nl != null && nl.getLength() > 0) {
                   for(int i = 0 ; i < nl.getLength();i++) {
                        //get the movie element
                        Element el = (Element)nl.item(i);
                        //get the Movie object
                        Movie mov = getMovie(el);
                        //add it to list
                        myMovies.add(mov);
          * I take an movie element and read the values in, create
          * an Movie object and return it
          * @param movE
          * @return
         private Movie getMovie(Element movE) {
              String title = getTextValue(movE, "original_name");
              String year = getTextValue(movE, "released");
              String imdbId = getTextValue(movE, "imdb_id");
              double score = getDoubleValue(movE, "score");
              String overview = getTextValue(movE, "overview");
              String poster = movE.getAttribute("url");
              Movie mov = new Movie(title, year, imdbId, score, overview, poster);
              return mov;
         private String getTextValue(Element ele, String tagName) {
              String textVal = null;
              NodeList nl = ele.getElementsByTagName(tagName);
              if(nl != null && nl.getLength() > 0) {
                   Element el = (Element)nl.item(0);
                   textVal = el.getFirstChild().getNodeValue();
              return textVal;
          * Calls getTextValue and returns a int value
          * @param ele
          * @param tagName
          * @return int
         private int getIntValue(Element ele, String tagName) {
              //in production application you would catch the exception
              return Integer.parseInt(getTextValue(ele, tagName));
          * Calls getTextValue and returns a double value
          * @param ele
          * @param tagName
          * @return double
         private double getDoubleValue(Element ele, String tagName) {
              return Double.parseDouble(getTextValue(ele, tagName));
          * Iterate through the list and print the
          * content to console
         private void printData(){
              System.out.println("Total Movies: " + myMovies.size());
              Iterator it = myMovies.iterator();
              while(it.hasNext()) {
                   System.out.println(it.next().toString());
         public static void main(String[] args){
              //create an instance
              XmlParser xp = new XmlParser();
              //call run example
              xp.runExample("http://api.themoviedb.org/2.1/Movie.search/en/xml/apikey/Fight+Club+1999", "movie");
    }Here is the example xml file I used
    <?xml version="1.0" encoding="UTF-8"?>
    <OpenSearchDescription xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
      <opensearch:Query searchTerms="Fight Club 1999"/>
      <opensearch:totalResults>1</opensearch:totalResults>
      <movies>
        <movie>
          <score>8.383284</score>
          <popularity>3</popularity>
          <translated>true</translated>
          <adult>false</adult>
          <language>en</language>
          <original_name>Fight Club</original_name>
          <name>Fight Club</name>
          <alternative_name>El Club de la Lucha</alternative_name>
          <type>movie</type>
          <id>550</id>
          <imdb_id>tt0137523</imdb_id>
          <url>http://www.themoviedb.org/movie/550</url>
          <votes>62</votes>
          <rating>8.4</rating>
          <certification></certification>
          <overview>A lonely, isolated thirty-something young professional seeks an escape from his mundane existence with the help of a devious soap salesman. They find their release from the prison of reality through underground fight clubs, where men can be what the world now denies them. Their boxing matches and harmless pranks soon lead to an out-of-control spiral towards oblivion.</overview>
          <released>1999-09-16</released>
          <images>
            <image type="poster" url="http://hwcdn.themoviedb.org/posters/f75/4bc908ab017a3c57fe002f75/fight-club-original.jpg" size="original" width="1000" height="1500" id="4bc908ab017a3c57fe002f75"/>
            <image type="poster" url="http://hwcdn.themoviedb.org/posters/f75/4bc908ab017a3c57fe002f75/fight-club-mid.jpg" size="mid" width="500" height="750" id="4bc908ab017a3c57fe002f75"/>
            <image type="poster" url="http://hwcdn.themoviedb.org/posters/f75/4bc908ab017a3c57fe002f75/fight-club-cover.jpg" size="cover" width="185" height="278" id="4bc908ab017a3c57fe002f75"/>
            <image type="poster" url="http://hwcdn.themoviedb.org/posters/f75/4bc908ab017a3c57fe002f75/fight-club-thumb.jpg" size="thumb" width="92" height="138" id="4bc908ab017a3c57fe002f75"/>
            <image type="backdrop" url="http://hwcdn.themoviedb.org/backdrops/f71/4bc908ab017a3c57fe002f71/fight-club-original.jpg" size="original" width="1280" height="720" id="4bc908ab017a3c57fe002f71"/>
            <image type="backdrop" url="http://hwcdn.themoviedb.org/backdrops/f71/4bc908ab017a3c57fe002f71/fight-club-poster.jpg" size="poster" width="780" height="439" id="4bc908ab017a3c57fe002f71"/>
            <image type="backdrop" url="http://hwcdn.themoviedb.org/backdrops/f71/4bc908ab017a3c57fe002f71/fight-club-thumb.jpg" size="thumb" width="300" height="169" id="4bc908ab017a3c57fe002f71"/>
          </images>
          <version>73</version>
          <last_modified_at>2010-09-11 14:33:06</last_modified_at>
        </movie>
      </movies>
    </OpenSearchDescription>

    pvujic wrote:
    Thanks, but how can I "fetch" the url from the image element?You've got to first get to the image element. But based on what you've posted though, with a little more coding, you should be able to succeed. Just give it a try! :)

  • How to Access Attributes of Fields in VARIANT

    Hi,
    Can anyone let me know how we can access Field attributes of a variant? I need to change and create these attributes dynamically.
    Below are the attributes of screen field saved when creating an variant
         Required field                            O
         Switch GPA off                            L
         Save field without values          P
         Selection variable                       L
         Hide field 'BIS'                            N
         Hide field                                    I
         Protect field                               P
        Field name                   Type   P  I  N  L  P  L  O
        P_REPID                        P                               X
        SO_VNAME                  S
    For Example
    If 'O' is marked as u2018Xu2019 against any field in the variant then it says that this field is OBLIGATORY
    I want to access this sort of information of a variant.
    Thanks
    Rajgopal Dara

    Hi RAJ,
    Although the question is not so clear, but as far as i understand you want to see the attributes associated with all the fields in your variant. if so then you can go to maintain variant. just go to se38, select variant as radio button and change it. In the variant maintenance screen you can select change attribute of your variant. you can click on that and pass dynamically values (either from some table like TVARV or from program)
    Hope this information will be helpful for you.
    Cheers !!
    Sourabh Batwara

  • Q: How to access and modify xml tags using Java

    I have an xml based document that i need to access and change. For example, the code
    <section id="section1">
    <div>
    <xforms:group id="id1">
    <xforms:label id="label1">
    <l style="font-size:16pt"> something </l>
    </xforms:label>
    </xforms:group>
    </div>
    </section>
    Working with Java I need to access all the tags, select some of them that are relevant to the current device and remade the document. I thought I would read the file character by character identifying the different labels and building a tree, storing in the tree nodes the relevant information as some kind of attributes (for example, in the case of the <xforms:group id="id1"> I would name the node "xforms:group" and create an "id" attribute with value "id1"). I'm not sure if that is the most efficient way of accessing the problem (computational power might be an issue), and would appreciate some help on the subject.
    Thanks,

    this may help you..
    this is a little util i made to help me read/write files.
    using this, you are only one step away from your solutions, you only need to figure out the regex you need to run on the text of the file to make it become what you need it to become.
    though if you use non-standard encoding, you might not want to use this code..
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.Arrays;
    public class ASCIIFile {
         private File file;
         private StringBuilder builder;
         public ASCIIFile(String path) throws IOException{
              file = new File(path);
              openFile();
         public ASCIIFile(File file) throws IOException{
              this.file = file;
              openFile();
         public void setNewFileName(String fileName){
              file = new File(file.getAbsolutePath(), fileName);
         public void setNewFilePath(String filePath){
              file = new File(filePath, file.getName());
         private void openFile() throws IOException{
              if(!file.exists()) file.createNewFile();
              BufferedReader read = new BufferedReader(new FileReader(file));
              String line = read.readLine();
              builder = new StringBuilder();
              while(line != null){
                   builder.append(line);
                   builder.append("\n");
                   line = read.readLine();
              read.close();
         public String getContents(){
              return builder.toString();
         public StringBuilder getStringBuilder(){
              return builder;
         public void setStringBuilder(StringBuilder b) throws IOException{
              setContents(b.toString());
         public void setContents(String contents) throws IOException{
              FileWriter writer = new FileWriter(file);
              writer.write(contents);
              writer.flush();
              writer.close();
              builder = new StringBuilder(contents);
         public static File[] getAllFilesUnderDir(String fullpath, boolean recursive) {
              ArrayList queue = new ArrayList(10);
              ArrayList matched = new ArrayList();
              File root = new File(fullpath);
              File[] files = root.listFiles();
              if (files == null || files.length == 0) {
                   return new File[] {};
              queue.addAll(Arrays.asList(files));
              for (int j = 0; j < queue.size(); j++) {
                   File child = (File) queue.get(j);
                   if (child.isDirectory() && recursive) {
                        files = child.listFiles();
                        if (files != null) {
                             queue.addAll(Arrays.asList(files));
                   } else { // child is file
                        matched.add(child);
              return (matched.size() > 0)?((File[]) matched.toArray(new File[] {})):(new File[] {});
    }

  • How to access query name in MSAccess Database?

    <p>
    I am using MsAccess as Database.The driver is not supporting some of the features, then how can I retrieve information such as getting the query name, if any way pls do help.
    Thanx.
    </p>

    Not sure I understand the question, but MS Access has some system tables which contain some informaiton on queries.

  • How to Access Item Names Property of ListBox inside of Cluster?

    In LabVIEW 2010 I have a Cluster of Controls on the Front Panel. In that Cluster I have a ListBox. How do I access the Item Names Property of the ListBox in my Block Diagram.
    From the Cluster, I can get the ListBox, but that returns an I32 value, probably the index of the selected Item.
    In the Block Diagram, how can I get the Item Name Property of the ListBox from a Reference to the Cluster?
    THANKS.
    Solved!
    Go to Solution.

    by using the "controls" array of your cluster, you can access the individual elements. You have then to convert the reference to a "more specific class" using a reference to an arbitrary listbox (or a constant reference of the required type), then you can access all properties of your listbox.
    THINK G!! ;-)
    Using LabView 2010 and 2011 on Mac and Win
    Programming in Microsoft Visual C++ (Win), XCode (Mac)

  • How to access the following xml data in Flex

    <users>
    <user dept id="HR">
         <user>
              <fname>mm</fname>
              <email>[email protected]</email>
         </user>
         <user>
              <fname>sss</fname>
              <email>[email protected]</email>
         </user>
    </dept>
    <user dept id="Finance">
         <user>
              <fname>ffff</fname>
              <email>[email protected]</email>
         </user>
         <user>
              <fname>www</fname>
              <email>[email protected]</email>
         </user>
    </dept>
    </users>
    using HTTP service through access the data
    this my user.xml file i want to display all the item in flex datagrid using tab navigator function................ each tab navigator contain one data grid for corresponding Dept like HR, sales , Finance
    corresponding information will display in data grid
    first tab navigatore is
    HR ->  data grid field like fname , Email
    finance -> fname, E Mail

    great for quick reply
    my XML file is data.xml
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    private var myUser:XML =
    <users>
    <dept id="hr">
        <user>
            <firstName>murali</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>bharathi</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>vasa</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    <dept id = "finance">
        <user>
            <firstName>mohan</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>vinoth</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    <dept ="sales">
        <user>
            <firstName>manoj</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
        <user>
            <firstName>deepan</firstName>
            <emailAddress>[email protected]</emailAddress>
        </user>
    </dept>
    </users>
    codings i used
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute" creationComplete="htp.send()">
        <mx:HTTPService id="htp" url="data.xml"
            result="resulthandler(event)"
            fault="faulthandler(event)"/>
            <mx:Script>
                <![CDATA[
                    import mx.collections.ArrayCollection;
                    import mx.rpc.events.FaultEvent;
                    import mx.rpc.events.ResultEvent;
                    [Bindable] private var userlist:ArrayCollection;
                    private function resulthandler(event:ResultEvent):void
                        userlist=(htp.lastResult.user.dept.user);
                    private function faulthandler(event:FaultEvent):void
                ]]>
            </mx:Script>
            <mx:TabNavigator>
            <mx:Repeater id="rep" dataProvider="{data.dept}"> <!--data.xml is my fle name-->
                <mx:Canvas label="{rep.currentItem.@id}">
                    <mx:DataGrid dataProvider="{rep.currentItem.user}">
                        <mx:columns>
                            <mx:DataGridColumn headerText="Name" dataField="fname"/>
                            <mx:DataGridColumn headerText="E Mail" dataField="email"/>
                        </mx:columns>
                    </mx:DataGrid>
                </mx:Canvas>      
            </mx:Repeater>
    </mx:TabNavigator>
    </mx:Application>
    its not show anything

  • How to access attributes of an instance?

    For example, I declared an instance of a CustomNode class "workspaceRow".
         Group{
             translateX: 50
             translateY: bind (wsY * -1) + (i*25);
             content:[
                     workspaceRow{
                          lineNumber: i.toString();
                        myColor: theColor;
                        onMouseEntered: function( e: MouseEvent ): Void {
                            selectedRow = i.toString();                  
         }How do I access lineNumber? I'm trying to use it for the onMouseEntered function inside the workspaceRow (as seen above), but Eclipse says it cannot find lineNumber, because it's looking for it at the top of the hierarchy (as in, looking for lineNumber declaration on my main *.fx file, instead of inside the instance). It's because I need to be able to store some data inside, and retrieve it later on.

    For that lineNumber thing, sorry about that. I was trying to access it in the onMouseEntered function, but decided to use var "i" instead, since it was what I used to generate a loop, and I use that same variable for lineNumber, but I know it'll give me problems later on.
    Yeah, forgot about capitalized class names, and yes, WorkspaceRow is a class extending CustomNode.
    Thanks a lot, your way worked. I am just wondering though, why doesn't JavaFX want to put the declaration and instantiation of the node inside Group{}? When I move those code blocks inside, Eclipse highlights the line "Group{" and says "unexpected type required: variable found : value".
    If I proceed with initializing the instance right on the declaration inside Group{}, it says "This is the type of cyclic reference to workspaceRowNow that prevents type inference.". As in like this:
              var workspaceRowNode = WorkspaceRow{
                     lineNumber: i.toString();
                   myColor: theColor;
                   onMouseEntered: function( e: MouseEvent ): Void {
                       selectedRow = i.toString();
                       print(workspaceRowNode.lineNumber);                  
              }Can anyone explain what that means?

Maybe you are looking for