AS3 & XML file reading in

Is there a need to read a XMl file into an array or can you load an XML file and then call the information when its needed. EX.  I have an xml file that I want to load in and then when the user clicks on a button they information that is requeted loads in from the xml file.  So not all the information from the XML file is needed at the time of load.  Is this possible or should I load it into an array?

Hope this will get you started:
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e72.html

Similar Messages

  • Parse XML file, read a tag with whitespaces value.

    Hi all,
    I've got a problem with reading a spaced value record from xml file using sys.xmltype.
    My xml file contains the following:
    <?xml version = '1.0'?>;
    <ROWSET>
    <ROW num="1">
    <FIRSTNAME>Nik</FIRSTNAME>
    <LASTNAME> </LASTNAME>
    <AGE>30</AGE>
    </ROW>
    </ROWSET>
    As you see last name contains four spaces!
    Now when I'm trying to read value from LASTNAME record I'm getting a NULL value, but I want it to return me those 4 spaces as they are.
    Here is a short code description of what I'm doing:
    declare
         xml sys.xmltype;
    str1 varchar2(100);
    str2 varchar2(100);
    begin
         xml := sys.xmltype.createxml(fileContentClob); -- I copy the file content into the fileContentClob variable.
         If xml.existsnode('//ROW['1']/LASTNAME') > 0 Then -- This condition evaluates as true
    str1 := xml.extract('//ROW['1']/LASTNAME/text()'); -- str1 gets NULL value :(, I want spaces as they are in the file.
    str2 := xml.extract('//ROW[' || 1 || ']/LASTNAME').getstringval; -- str2 gets <LASTNAME/> null tag :(.
         End If;     
    end;
    Seems like when it createxml from the fileContentClob it ignores the spaces and find LASTNAME as a null field.
    Do you have any suggestions on how can I fix that, so I can read whitespaces as they are in the file?
    I generate the file also using a xml toolpackage from oracle:
    declare
    strSqlStmt Varchar2(300);
    varCtxHdl dbms_xmlquery.ctxhandle;
    varClob Clob;
    begin
    strSqlStmt := 'SELECT FIRSTNAME,LASTNAME,AGE FROM USERS WHERE ROWNUM =1';
    varCtxHdl := dbms_xmlquery.newcontext(strSqlStmt);
    varClob := dbms_xmlquery.getxml(varCtxHdl);
    dbms_xmlquery.closecontext(varCtxHdl);
    End;

    Even if the STORE AS CLOB clause is used to store the data and preserve whitespace for the XML, the actual extraction of data seems to be removing whitespace...
    SQL> ed
    Wrote file afiedt.buf
      1* create table t (xml xmltype) xmltype xml store as clob
    SQL> /
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1  insert into t (xml)
      2  values (q'[<?xml version = '1.0'?>
      3  <ROWSET>
      4  <ROW num="1">
      5  <FIRSTNAME>Nik</FIRSTNAME>
      6  <LASTNAME>    </LASTNAME>
      7  <AGE>30</AGE>
      8  </ROW>
      9* </ROWSET>]')
    SQL> /
    1 row created.
    SQL> select * from t;
    XML
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <FIRSTNAME>Nik</FIRSTNAME>
    <LASTNAME>    </LASTNAME>
    <AGE>30</AGE>
    </ROW>
    </ROWSET>
    SQL> set null NULL
    SQL> select x.rnum, x.firstname, x.lastname, x.age
      2  from t
      3      ,xmltable('/ROWSET/ROW'
      4                PASSING t.xml
      5                COLUMNS rnum      NUMBER       PATH '/ROW/@num'
      6                       ,firstname VARCHAR2(10) PATH '/ROW/FIRSTNAME'
      7                       ,lastname  VARCHAR2(10) PATH '/ROW/LASTNAME'
      8                       ,age       NUMBER       PATH '/ROW/AGE'
      9               ) x
    10  /
          RNUM FIRSTNAME  LASTNAME          AGE
             1 Nik        NULL               30
    SQL>

  • Xml file read in a single line

    HI All,
    I have configured a scenario FILE-FILE to generate a XML file as output(input also xml file). It has created xml file successfully, and this file is transferred from ECC5.0 to 4.7. In 4.7 this xml file is read by a particular program in which it is reading the entire file as a single line. This means that its not detecting end of line.
    How can I resolve this??
    Plz suggest.
    rgds,
    anil

    Hi Satish,
    If I understand, the program needs to read an xml file as a single line. If so, look at Michal weblog /people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions
    With this simple xslt program you can put a whole xml file into a string. If you also need the inverse, string to xml, looks at the Henrique Pinto reply on bottom of weblog
    To use XSLT programs you have 2 options:
    XSLT-ABAP Engine -> /people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
    Or you can paste the xslt code in a txt file, zip the file and import it to XI as Imported Archives.
    Hope it helps you
    Ricardo.
    Message was edited by: Ricardo  Quintino

  • DOM xml file, reading

    I have an XML file I am parsing, or trying to parse. I can get the Document object but how do you traverse the elements?? It seems simple but the Node methods are somewhat vague in what they return, per the Javadoc. I've tried trial and error to much frustration and very little success...
    is there an easy way to traverse the xml elements in a DOM Document object? I'm using the org.w3c package for most of what I'm doing...
    I'm sure this is just a few lines of code but it's been driving me crazy.

    from the document you would do,,
    Element e = document.getDocumentElement();
    From there you have two choices, you can navigate strictly via the tree with, calls of
    Element child = e.getFirstChild();
    while (child != null)
    //do something
    child = child.getNextSibling();
    or you can collect all the Elements that have a certain tag, as in
    NodeList list = e.getElementsByTagName( "MyElementName" );

  • XML File Read Process

    Hi,
    I have a requirement to read .xml file which has the following data in the file.
    <WFPaymentAck>
    <PmtID>500001</PmtID>
    </WFPaymentAck>
    I want to read the file and to access the data which is present in <PmtID> tag. i.e., 500001.
    I tried couple of ways but I'm getting the following error when I try to access the data from Assign activity using "getVariable" method (for example: bpws:getVariableData('Receive_Read_InputVariable','body','/ns2:WFPaymentAck/ns2:PmtID')).
    +Error in evaluate <from> expression at line "69". The result is empty for the XPath expression : "/ns2:WFPaymentAck/ns2:PmtID".+
    Please brief me the steps to how to go about in doing this.
    Thanks in advance.
    Regards,
    achapla

    Hi Rolando,
    Thanks for the response.
    These are the steps I'm following.
    1) Created a project.
    2) Created a xsd schema using "XML Schema from XML Document"
    XML Document has the following data
    <WFPaymentAck>
    <PmtID>500001</PmtID>
    </WFPaymentAck>
    3) It is creating the XSD as given below.
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.example.org"
    targetNamespace="http://www.example.org"
    elementFormDefault="qualified">
    <xsd:element name="WFPaymentAck">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="PmtID" type="xsd:integer"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    4) When I'm creating a file adapter I'm providing the URL of the XSD which was created above (step 3).
    Here the targetNamespace is "http://www.example.org"
    5) I'm creating a receive activity and trying to access the data but i'm not able to get the data.
    Note: I could view the data in the receive activity (from EM console) but not able to access in assigne activity.
    I did not get where exactly I need to use the Namespace (correctly).
    Please suggest.
    Thanks.
    Regards,
    achapla

  • Xml file read help

    hello,
    when i get ResultSet i can say
    rs.getString ("Col name or Number here");
    if i read XML File can i say
    semething.getString("element Name? or another idea?");
    thx

    http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPSAX.html
    Run through the tutorial quickly, all of your questions will be answered. Its fairly easy.

  • Problem in XML file Read

    Hi Gurus,
    1. In the code, CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD has been used
    to uplaod the excel sheet data.
    2. After upload,its been tried to convert the uploaded data to XML by following
    code.
    ixml = cl_ixml=>create( ).
    xmlDoc = ixml->create_document( ).
    streamFactory = ixml->CREATE_STREAM_FACTORY( ).
    iStream = streamFactory->CREATE_ISTREAM_STRING( xmlString ).
    iXMLParser = iXML->create_parser( stream_factory = streamFactory
    istream = iStream
    document = xmlDoc ).
    iXMLParser->parse( ).
    ixmlDocument = xmlDoc.
    3. After creation of xmlDoc its trying to get root element from xml doc by
    rootnode = if_ixml_document~get_root_element.
    its not returning the root element reference to rootnode.
    4. In method cl_ixml_document->if_ixml_document~get_root_element, its calling
    below statement
    system-call ixml
    did 954859521
    parameters
    cl_ixml=>the_iXML
    me
    name
    rval.
    and rval has became null reference.
    Could anyone help me to resolve this problem.
    Thanks & Regards,
    Bhuvana.

    Hi,
    Now I could able to execute the same program. But I couldn't get and node data from the imported file.
    1. In the code, CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD has been used
    to uplaod the excel sheet data.
    2. After upload,its been tried to convert the uploaded data to XML by following
    code.
    ixml = cl_ixml=>create( ).
    xmlDoc = ixml->create_document( ).
    streamFactory = ixml->CREATE_STREAM_FACTORY( ).
    iStream = streamFactory->CREATE_ISTREAM_STRING( xmlString ).
    iXMLParser = iXML->create_parser( stream_factory = streamFactory
    istream = iStream
    document = xmlDoc ).
    iXMLParser->parse( ).
    ixmlDocument = xmlDoc.
    3. After creation of xmlDoc its trying to get root element from xml doc by
    <b>rootnode = if_ixml_document~get_root_element.
    name = rootnode->get_attribute( 'name' ).</b>
    I am not getting other node data also ?
    I couldn't find where I am doing the mistake.
    Can any one help me ?

  • Please help with XML file reading

    Please advise on how to read the below file into oracle table. Thank you.
    <?xml version="1.0"?>
    <transactionset replyNode="SIR" numTransactions="2">
    <RType>1</RType><ScreenID>SDEF356 439</ScreenID><AnalystName>John</AnalystName><AdjustmentDate>12212008</AdjustmentDate><LenderID>1000</LenderID><LoanNumber>1234561</LoanNumber><EffectiveDate>11112008</EffectiveDate><PoolNumber>111</PoolNumber><RemittanceType>1</RemittanceType><CashLoanIndicator>Y</CashLoanIndicator><ElementDescription>Loan Integrity Rules</ElementDescription><Beforevalue>5085219</Beforevalue><AfterValue>500002004</AfterValue><ReportingMonth>040408</ReportingMonth><AdjustmentTime>12:07:00 am</AdjustmentTime><SpecialFeature><spl_feat_code>1</spl_feat_code><spl_feat_code>5</spl_feat_code><spl_feat_code>8</spl_feat_code><spl_feat_code>10</spl_feat_code><spl_feat_code>11</spl_feat_code></SpecialFeature><FutureFeature><fut_feat_code>100</fut_feat_code><fut_feat_code>200</fut_feat_code></FutureFeature>
    <RType>1</RType><ScreenID>SDEF356 439</ScreenID><AnalystName>Mike </AnalystName><AdjustmentDate>12212008</AdjustmentDate><LenderID>1000</LenderID><LoanNumber>4445561</LoanNumber><EffectiveDate>11112008</EffectiveDate><PoolNumber>222</PoolNumber><RemittanceType>1</RemittanceType><CashLoanIndicator>Y</CashLoanIndicator><ElementDescription>LoanRules</ElementDescription><Beforevalue>5085219</Beforevalue><AfterValue>500002004</AfterValue><ReportingMonth>040408</ReportingMonth><AdjustmentTime>12:07:00 am</AdjustmentTime><SpecialFeature><spl_feat_code>11</spl_feat_code><spl_feat_code>15</spl_feat_code><spl_feat_code>18</spl_feat_code><spl_feat_code>20</spl_feat_code><spl_feat_code>21</spl_feat_code></SpecialFeature><FutureFeature><fut_feat_code>400</fut_feat_code><fut_feat_code>500</fut_feat_code></FutureFeature>
    </transactionset>

    Ways that come to mind (since I know nothing of your DB version or the real requirements behind the question)<br><br>
    1) Use SQL*Loader to load directly into the table<br>
    2) Read the file using UTL_FILE and INSERT that into the table<br>
    3) Use an External Table to read the data in before doing an INSERT into the table<br>
    4) DBMS_XMLPARSER.PARSE<br>
    5) DBMS_XSLPROCESSOR<br><br>
    I know more exists in 10g and 11g but I can't think of them off the top of my head.

  • How to xml file load in actionscript 3.0

    Hi surfers,
    How to xml file load in actionscript 3.0, How to get xml data.
    Thanks in Advance.
    Pls give me ASAP, i'm struggle here.

    Search Google using "AS3 XML tutorial".

  • Question about insert date value from xml file

    I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
    oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
    eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
    Thanks for anyone that can fix my problem or give me any suggestion.
    email: [email protected]

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by matmnwx:
    I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
    oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
    eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
    Thanks for anyone that can fix my problem or give me any suggestion.
    email: [email protected]<HR></BLOCKQUOTE>
    Use:
    OracleXMLSave sav = new OracleXMLSave(conn,tabName);
    sav.setDateFormat(<hier the date format in the XML-File>);

  • Error while loading xml files using JDBC

    Hi,
    I am trying to load xml files into an xmltype table using JDBC calls and am getting this error for some files
    LPX-00200: could not convert from encoding UTF-8 to UCS2
    The xml files and our database are both UTF-8 encoded. The version of oracle that we have here is 9.2.0.6
    Any suggestions in this matter will be greatly appreciated.
    Thanks,
    Uma

    I also experienced this problem and unfortunately this solution didn't work for me given that the tag you suggested was already on the XML file.

  • How I could generate an XML file from a report in version 4.0B

    Good morning,
    How could I generate an XML file from a report? Please note that I am using version 4.0B
    I don't have access to
    Billy Vital

    Hi,
            In the Class CL_XML_DOCUMENT,
                 we have a method  EXPORT_TO_FILE to download an XML file.

  • Remove ?xml version="1.0" encoding="UTF-8"? from xml file

    I have generated an XML file using sax paraser. In the XML file thats generated I have the version and the encoding line
    <?xml version="1.0" encoding="UTF-8"?>which is automatically generated in my XML file. Is there any way that I can avoid that from the XML file thats generated.

      try
                            FileWriter fr = new FileWriter(new File(path, fileName));
                            Document docNode = docNodeMap.get(name);
                            XMLOutputter outputter = new XMLOutputter();
                            outputter.output(docNode, fr);
                            fr.close();
                    catch (IOException e)
                            e.printStackTrace();
                    }this the code generating xml file.

  • XML file to Proxy Scenario with BPM - ID Steps

    Hi Guys,
    Any one can help me to find  about the scenario XML file to ABAP Proxy with BPM, ID steps please. Any link or logical routing, receiver determination and interface determination idea. Please correct me,
    I have created Business Service as sender to send one xml file to BPM, BPM is sending a message to SNC system. I have created 2 receiver determinations, but I am confusing in interface determination, where to declare OM?
    Please can any one respond bit quicker.
    Thanks  in advance
    Regards
    San

    ES Repository
                         *Service Interfaces*
    Create one outbound service interface for XML file.
    Create one Inbound synchronous Interface for SNC system.
    Create one Abstract Asynchronous interface ,same message type as you used for outbound service interface .This is for Integration process receive step.
    Create one Abstract async interface for receiving the response from SNC system in Integration process.
    Create one Abstract synchronous interface to be used in the Integration process for Send sync step.
    Create on inbound asyn service interface for sending the response from integration process (received from SNC system) to the Receiver System.
                  Operation Mapping.
    Create an Operation Mapping using Abstract sync interface and inbound syn interfaces.
                  Integration Process
    start--->receive Step---->send Synchronous step----->send step.
    Create two container elements
    first with abstrat async interface for the XML request.
    second for abstract asyn interface with the XML response structure (asyn receiver system structure)
    In the send sync step select your abstract syn interface from the F4 help.and select the corresponding request and response message from the container element you defined earlier.
    Integration Directory.
    Create one sender File adapter Communication channel for XML file reading.
    Create two receiver communication channel for sync system(receiver XI adapte for ABAP PROXY) and other for asyn receiver system .
    Create 3 receiver determination
    1.from sender to Integration process.
    2.from Integration process to SNC system.
    3. from Integration process to Asyn Receiver System.
    Create 3 Interface determination.
    Specify Operation mapping while you are creating interface determination from Integration Process to Syn BS.
    Create one sender agreement
    Create two Receiver agreement.
    Regards
    Kubra Fatima.

  • GUI from an XML file

    Hello everybody,
    My problem is this: I have to do a GUI from an XML file. I am a begginer in JAVA, in GUI development and in XML. So... my situation is a bit difficult. What I have in mind is, if possible, to have a kind of function (that maybe already exists) that opens the XML file, read the whole document, keep the information in some variables and, from them, I can build the GUI using Swing. Is it possible this? Any help please, any idea?
    Thanks a lot!!
    Fran.

    Of course, this is possible. But what kind of "GUI XML" are you talking about? Is the XML given? Does it already conform to some GUI-XML-API? Give more infos!

Maybe you are looking for

  • Why can't I use a DA 867 or 733 cpu in my DA 467?

    I want to upgrade my DA at least expense. It is used chiefly for Sibelius, not on line much. I have 1G memory and 60G storage. Can do the 4th bolt 12 v thing on Quicksilver cpu's , I think. What is the difference in the 467/533 and 733/867 DA's? Is t

  • How do I transfer the albums on my IPOD to iTunes on my PC?

    I have had to reset my PC following a Malware attack.  As a result all programmes have had to be re-installed including iTunes. I have 87 albums on my iPOD but can only get 6 of them back onto iTunes on the PC. These are 6 CDs which were bought from

  • Viewing flash based website in HTML component of AIR APP

    Hello,  I've got an air app where I'm trying to use the Html component to load up a flash website.  Problem is that the website starts to load (I can see the preloader) and then the html component just goes blank.  I wrote the html page I'm trying to

  • DFSr supported cluster configurations - replication between shared storage

    I have a very specific configuration for DFSr that appears to be suffering severe performance issues when hosted on a cluster, as part of a DFS replication group. My configuration: 3 Physical machines (blades) within a physical quadrant. 3 Physical m

  • Howto register a renderer

    Can someone tell me some more insight on how to register a renderer? Suppose I use the following XML file: <POLICYPROPERTYBUNDLE> <NAME>CUSTPOLICYPROPERTYBUNDLE</NAME> <PROPERTIES> <PROPERTY> <NAME>SmbRenderer</NAME> <VALUE Datatype="SystemObject" Cl