How to: Display Specific Xml Entry in AS3

I have a very simple line of code that i'm trying to modify to display a specific entry in a xml file:
AS3 Code:
// The first step is to activate the XML object
AmbientSettingsXML = new XML();
With the XML Object now active you must now load an XML foramtted document.
Any DTD or XLS formatting will be ignored.
AmbientSettingsXML.onLoad = myLoad;
AmbientSettingsXML.load("settings.xml");
// Before proceeding to far into the program, make sure the XML document has loaded
// Extract information from the XML file
function myLoad(ok) {
if (ok == true) {
trace("ok");
trace(AmbientSettingsXML);
The Trace Displays:
ok
<?xml version="1.0"?>
<settings>
<appearance>
<event_title>Streaming Demo 1</event_title>
</appearance>
</settings>
So the question is, how do I display the "event_title" entry only? (String)
Any help is appreciated,
Thanks!

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, completeHandler);
var request:URLRequest = new URLRequest("yourxmlfile.xml");
loader.load(request);
function completeHandler(event:Event):void {
var loader:URLLoader = URLLoader(event.target);
var xml:XML = XML(loader.data);
//xml.child("appearance")[0].child("event_title")[0];

Similar Messages

  • How to display an XMl file in a webydynpro Application.

    Hi All,
    I am working with a webdynpro application where i have an xml file. when ever i run the webdynpro application it has to display that xml file in the browser instead of view. It would be appreciable if anyone give me some idea on how to start this application
              Thanks in advance
    Regards
    ravi

    HI Ravi,
    Insert a portalIFRame or IFrame with width 100%.
    Create a context variable (Say xmlFile) of type String and bind to Source property of PoratlIFrame .
    Put the xmlfile inside Project\src\mimes\Components\Package\
    Let the xml file name be Config1.xml.
    Write the following code inside wdDoinit()
    wdContext.currentContextElement().setPortalFrame(WDURLGenerator.getWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"Config1.xml"));
    Regards
    Fahad Hamsa

  • How to display an XML in Web Dynpro

    Hi,
    I am pretty new to Web Dynpro and have a specific requirement.
    I have a web dynpro page on which we display a table. One of the columns in the table is a XML message. Now on lead selection of each row I want to display the contents of the XML in an embedded control below the table. I have already implemented the functionality to download the XML message to file system but I want a capability to show the XML contents within my page in a formatted way.
    If I use a text view, the XML does not look very nice.
    I do not want to implement a new tree control based control now where I parse my xml file and then try to recursively generate a tree. This will take time for me as i am not very well versed with WD programming.
    Can anyone tell me if there exists any control in WD which can display the XML in formatted way?
    If you guys have used the new ABAP debugger and seen the XML viewer in it then you can get an idea of what I need. I am not sure about the control that the ABAP debugger uses. It will be good if someone can help me find something like that.
    After all WD is all about reusability.
    Regards,
    Vikas

    Hi Vikas,
       see this little example which creates a xml file to download and open in the browser. Put it in an action handler method.
    DATA lr_conv   TYPE REF TO cl_abap_conv_out_ce.
      DATA lv_data   TYPE        string.
      DATA lv_xfile  TYPE        xstring.
      lv_data = '<?xml version=1.0" encoding="utf-8"?> put your xml here'.
      cl_abap_conv_out_ce=>create( RECEIVING conv = lr_conv ).
      lr_conv->convert( EXPORTING data   = lv_data
            IMPORTING buffer = lv_xfile ).
      cl_wd_runtime_services=>attach_file_to_response(
                     EXPORTING
                         i_filename  = 'test.xml'
                         i_content   = lv_xfile
                         i_mime_type = 'application/xml' ).
    Hope this helps you. Revert if need some more help.
    Regards,
    Pavan.

  • How to display an XML file as it is in browser that XI sent to my J2EE appl

    Hi all!
    I have a scenario like File->XI->J2EE appl.
    The file is getting picked up from my machine by XI.
    Now XI should send that XML file to my J2EE appl.
    My servlet receives that XML and displays as it is in browser. But am getting some error like:
    XML page cannot be displayed.
    XML document must have a top level element. Error processing resource 'http://localhost:7001/Invoke/DisplayRes'.
    I deployed my .ear file on BEA Weblogic application server9.0
    I found no error when i tested in SXI_MONI and RWB->Message monitor as well.
    This is my servlet code:
    public class DisplayRes extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    doPost(request,response);
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    BufferedReader brin =new BufferedReader(new InputStreamReader(request.getInputStream()));
    String inputLine;
    StringBuffer sBuf = new StringBuffer();
    PrintWriter out = response.getWriter();
    response.setContentType("text/xml");
    while ((inputLine = brin.readLine()) != null)
    sBuf.append(inputLine);
    //out.setContentType("text/xml");
    //out.println(sBuf.toString());
    out.write(sBuf.toString());
    brin.close();
    out.flush();
    what went  wrong? Help me
    Thanks

    Hi
    Can anyone tell me how XI sends messages to applications like J2EE. In REceiver comm channel, I think we specify about the target system like J2EE appl.
    Aadapter Type: HTTP
                   Receiver
    Transport Protocol:  HTTP1.0
    Message Protocol:    XI payload in HTTP body
    Adapter Engine:      Integration Server
    Addressing Type:     URL address
    Target host:         localhost
    Service Number:      7001(Port number of Weblogic appl server--where my J2EE appl is deployed).
    Path     :  /Invoke/DisplayRes/
    Authentication Type:Use Logon Data for SAP System
    Content Type: text/xml
    Username:   xiappluser
    password:   xx
    XML code:   UTF-8
    I suppose XI sends msgs to http://localhost:7001/Invoke/DisplayRes/........
    in this example if am correct?
    Then I have given all tyhe necessary setting but my servlet is not able to display XML msg in browser?
    This is my servlet code:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
         PrintWriter out = response.getWriter();
         BufferedReader brin =new BufferedReader(new InputStreamReader(request.getInputStream()));
         String inputLine;
         StringBuffer sBuf = new StringBuffer();
            response.setContentType("text/xml");
         while ((inputLine = brin.readLine()) != null)
             sBuf.append(inputLine);
             out.println("hi");            
                out.println(sBuf.toString());
             brin.close();
             out.flush();
    What went wrong?
    Help me, all helpful answers are highly rewarded.
    Thanks

  • How to  display / Embed XML in jsp ?

    hi, i have following files in my project and i would like to display stocks.xml file in jsp, when i open stocks.xml file in browers , it opens nice with the xsl style , but i can't seem to add it in my jsp. ?. my jsp only displays simple raw text from xml not the style as it is shown in browser by just clicking the stocks.xml file.......... thanks in advance ...
    ==============index.jsp=====================
    <%@ page contentType="text/xhtml" %>
    <html>
    <head>
    <title>Sample Application JSP Page</title>
    </head>
    <body bgcolor=white>
    <table border="0">
    <tr>
    <td align=center>
    <img src="images/logo.gif">
    </td>
    <td>
    <h1>Sample Application JSP Page</h1>
    application.
    </td>
    </tr>
    </table>
    <%= new String("Hello!") %>
    *{color:#ff6600}<jsp:include page="stocks.xml"></jsp:include>{color}*
    </body>
    </html>
    ==========stocks.xml======================
    <?xml version="1.0" encoding="UTF-8"?>
    {color:#339966}<?xml-stylesheet type="text/xsl" href="stocks.xsl"?>{color}
    <portfolio>
    <stock>
    <symbol>SUNW</symbol>
    <name>SunMicrosystems</name>
    <price>17.1</price>
    </stock>
    <stock>
    <symbol>AOL</symbol>
    <name>America Online</name>
    <price>51.05</price>
    </stock>
    <stock>
    <symbol>IBM</symbol>
    <name>International Business Machines</name>
    <price>116.10</price>
    </stock>
    <stock>
    <symbol>MOT</symbol>
    <name>MOTOROLA</name>
    <price>15.20</price>
    </stock>
    </portfolio>
    ===============================================
    ==================stocks.xsl======================
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">
    <xsl:template match="/">
    <html>
    <head>
    <title>Stocks</title>
    </head>
    <body bgcolor="#ffffcc" text="#0000ff">
    <xsl:apply-templates />
    </body>
    </html>
    </xsl:template>
    <xsl:template match="portfolio">
    <table border="2" width="50%">
    <tr>
    <th>Stock Symbol</th>
    <th>Company Name</th>
    <th>Price</th>
    </tr>
    <xsl:for-each select="stock">
    <tr>
    <td>
    <i>
    <xsl:value-of select="symbol" />
    </i>
    </td>
    <td>
    <xsl:value-of select="name" />
    </td>
    <td>
    <xsl:value-of select="price" />
    </td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl:template>
    </xsl:stylesheet>
    Edited by: s_dhillon on Aug 31, 2008 8:15 PM
    Edited by: s_dhillon on Aug 31, 2008 8:21 PM

    Am not sure..
    may be by contentType

  • How to Display Specific ID in XML?

    Hey Guys and Gals,
    I've got the following XML that I'm trying to display:
    <section id="0">
    <sectionCat>Page Title</sectionCat>
    <sectionDesc>
    <![CDATA[
    <fieldset><legend>TEST
    TEST</legend></fieldset>
    ]]>
    </sectionDesc>
    <imgName></imgName>
    </section>
    There are 10 sections of XML in the file (section ID 0
    through 9). Within one dataset, I just want to display the first
    two sections. In a second dataset, I want to display the remaining
    sections. How would I go about doing this? My dataset call looks
    like this:
    var dsSections = new Spry.Data.XMLDataSet("testfile.xml",
    "/sections[section = '0']");
    dsSections.setColumnType("sectionDesc", "html");
    But that's of course not working .. Any suggestions?
    Any help would be appreciated.
    Thanks.

    "kraftomatic84" <[email protected]> wrote in
    message
    news:gpo9ok$1o2$[email protected]..
    > So how would I grab the specific node with a specific
    ID? I'm not sure
    > how this would help specifically ..
    This could help:
    http://www.w3schools.com/xpath/xpath_syntax.asp
    Looks like something like this should work for you:
    "/sections[@section=1]"
    Please note since I don't have the whole XML I am unable to
    test it myself.
    Hope it will help anyway.
    Massimo Foti, web-programmer for hire
    Tools for ColdFusion, JavaScript and Dreamweaver:
    http://www.massimocorner.com

  • ABAP Query - How to display non-zero entries

    Hi All,
    I have created a simple query having the join of 4 tables.
    Now I need to display the output for only non-zero entries of a particular field.
    How this can be achieved ?
    Please let me know-
    1) Either , there are ways to restrict the entries during selection itself(I do not want to give this field in selection screen)
    2) Or , Delete the entries having zero value before display.
    I debugged the standard report for query and found out the internal table where the
    result is stored, but it is not allowing to be used in the coding sections of infoset.
    Thanks ,
    Neethu

    In select add condition field1 NE 0 or SPACE.
    Edited by: Shaik Hussain on Nov 30, 2010 1:46 PM

  • How to display the xml content into my datagrid

    Hi Experts,
                     i have created a webservice for sales quotation through DI-Server.iam able to add a new sales quotation through my coding & iam able to get the sales quotation based on the DOcEntry in an *XML file*.
              The xml file that i got using DOCENTRY is in this way:--
    <?xml version="1.0" encoding="utf-8" ?>
    - <BOM>
    - <BO>
    - <AdmInfo>
      <Object>oRecordset</Object>
      </AdmInfo>
    - <OQUT>
    - <row>
      <DocEntry>8</DocEntry>
      <DocNum>8</DocNum>
      <DocDate>20080715</DocDate>
      <DocDueDate>20080815</DocDueDate>
      <CardCode>C0003</CardCode>
      <CardName>HP India</CardName>
      <DocTotal>14500.000000</DocTotal>
      <ItemCode>A00006</ItemCode>
      <Dscription>HP Officejet 7310 All-in-One</Dscription>
      <Quantity>1.000000</Quantity>
       <Price>14500.000000</Price>
      <Currency>INR</Currency>
       <DiscPrcnt>10.000000</DiscPrcnt>
      <LineTotal>14500.000000</LineTotal>
       </row>
      </OQUT>
      </BO>
      </BOM>
    Now the problem is from this xml content i should display the values in my datagrid like:
    DocEntryCardCodeDocDueDateItemCodeDscriptionQtyTotal
         8--C000320081116--A00006-HP-off jet-2 ---                     1000
    can anybody suggest me some ideas that how to get the SPECIFIED values into my datagrid...........
    regards,
    shangai.

    hi vincent,
                    Thanks for your reply.iam unable to understand these lines in your code..iam working in vb.net
    public static DataSet GetDataSetFromXML(XmlNode XMLNode)
    grid.DataSource = GetDataSetFromXML(Result.SelectSingleNode(xpath_string));
    this is my coding....it's throwing an error when i declare like this
    Public Sub GetDataSetFromXML(ByVal XmlNode)
            Dim ds As New DataSet
            Dim reader As XmlNodeReader
            reader = New XmlNodeReader(XmlNode)
            ds.ReadXml(reader)
            reader.Close()
            'Return ds --->(error with syntax)
        End Sub
    DataGrid1.DataSource = GetDataSetFromXML(oXmlReply.SelectSingleNode("//DocDueDate"))
                DataGrid1.DataBind()
    regards,
    shangai

  • Displaying Specific xml data.

    Hi there,
    I have a database exporting stock detail as xml data.  I've been using spry to format.
    What I was wondering, is it possible to filter to display only certain data?
    My xml data contains electrical products. Can I filter to only display certain products?
    For example I only want to display when Product type is Fridge and Brand is BEKO.
    Product type, Brand, Description, Price
    Sorry, but I'm really stuck.  I can't work out how to do it!
    Many thanks,
    Martin

    The xml contains full details for anywhere between 70 to 100 products.  I've pasted the fields in below.  Does the entire xml have to load before it can filter?  If so I might need to look at the xml output.  I only want the user to be able to see specifc products depending on the page they are on.  So if they navigate Television/Panasonic the spry only displays those products.
    Thanks for your advice so far.
    {@BulletPoints}
    {@ClearanceItem}
    {@Colour1}
    {@Group1}
    {@Group2}
    {@Group3}
    {@Image}
    {@LongDesc}
    {@Make}
    {@ManufactureGuarantee}
    {@ModelNo}
    {@NewItem}
    {@OldPrice}
    {@PackQty}
    {@SellingPrice}
    {@ShortDesc}
    {@SpecialOffer}

  • How to display an xml file using a servlet with the styles given in an XSL

    Dear Developer...
    i have xml and xsl files.
    Now i want to display the html output produced by the xsl and xml using a servlet...give me any samplecode.

    ... except for the "using XSLT" part. But that doesn't make sense anyway because XSLT doesn't display anything, it just transforms data.

  • How to display an xml file as a tree in html

    Hi, JAVA/XML/XSLT/HTML gurus,
    I have an xml file and want to display it as a tree in html using XSLT.
    Is there any example for this?
    King regards,
    AG

    ... except for the "using XSLT" part. But that doesn't make sense anyway because XSLT doesn't display anything, it just transforms data.

  • How to display an xml file contents in jsp as tree view

    hi,
    Iam trying to read an xml file and display the structure in jsp as tree view, can any one help me

    Use a [XML or DOM parser|http://java-source.net/open-source/xml-parsers] to read a XML file into a tree structure of Java objects.
    Use the [Collections API|http://java.sun.com/docs/books/tutorial/collections/index.html] to get hold of the relevant elements in a tree structure.
    Use JSTL´s [c:forEach|http://java.sun.com/javaee/5/docs/tutorial/doc/bnakh.html] tag to iterate over a Collection in JSP.
    Use HTML´s [<ul>/<li>|http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.2] or [<dl>/<dt>/<dd>|http://www.w3.org/TR/REC-html40/struct/lists.html#h-10.3] tags to represent a tree in HTML.

  • How to display transformed XML in flex? xslt processor w/o javascript?

    I have a tree view with a list of links. upon clicking the links it will display its contents in an iFrame.
    some of the links in my tree are, google.com, yahoo.com, and 2 xml files, 1 of which i have transfromed into html using xsl.
    google, yahoo and the xml file which i have not transformed display successfully in the iFrame. however the xml which i have transformed does not display anything. is there another way to display html in flex? or is there a way to display a transformed xml to html in flex.
    also is there another way to to use an xslt processor in flex without having to use javascript?

    In jsp page set content type to text/xml
    <%@ page contentType="text/xml" %>

  • How to display & inside xml

    Hi experts,
    Im folllowing this blog by felin on xl to xml..
    im getting an error every time the cell has &...eveything else is fine
    pls let em know

    Hi Guys,
    My module code has
    xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"+ "<ns0:""MT_Test"" ""xmlns:ns0=\"""urn:test:excelfiles"+"\"> \n ";
      int a = w.getSheet(0).getRows();
      int b = w.getSheet(0).getColumns();
    for(int j=1;j<a;j++)
           for(int i=0;i<b;i++)
           xmldata = xmldata "\n" "<"w.getSheet(0).getCell(i,0).getContents().toString()">"w.getSheet(0).getCell(i,j).getContents().toString()"</"w.getSheet(0).getCell(i,0).getContents().toString()">"+ "\n";
    xmldata = xmldata" </ns0:""MT_Test"+">";
    Now, If cell (2,2) has &... how do i adjust the code?
    cos its a string right?

  • How to display specific page based on type of user login? Urgent!!!

    I have 2 type of users e.g. Type1 and Type2 if Type1 user logs in i want to display a Type1Page page and if Type2 user logs in i want to display Type2Page page as home page.
    If there is any article already on this forum give me clue or Please give a workaround for this one.
    Thanks
    Bakulesh

    If you're setting the homepage in user preferences, I think you could do better. If they're "types" of users, set the default home page for their respective groups, not individual users.

Maybe you are looking for

  • How can I copy my contacts on my ios to my email

    I have a new email and I want all the conacts on my iCloud to be copyed in to the email I`m using an iPhone 4 & iPad 3 all updated to 6.1

  • WLC 7.2.103.0 RADIUS Accounting

    Hello, I recently upgraded WiSM2 controllers to the 7.2 release and have found that quite a few Accounting Start and Stop packets arrive at the RADIUS server without the Framed-IP-Address.. We use it to login the wireless user into SCE so they are no

  • Private VLAN in Wireless

    I want no two wireless client on the same access-point can acces s each other. Is it possible for standalone AP? or Controller Based? THANKS

  • Installing J2EE  Patches during WAS installation

    Hi Himanshu Limaye here. I am <b>currently installing J2EE patches using SAPCAR utility.</b>However one of the .sar files is not getting uncarred properly. <b>The file name is: J2EERT15_0-10001982.SAR</b> I <b>repeated the procedure</b> by again down

  • Text size/text in browser size wrong (ff22)

    There are some problems with my Firefox 22.0 since yesterday. It started to show websites' text too large, had to use Ctrl and "-" every time I accessed any website. However, things how text looked in FF menus did not change. My actions: 1) FF forums