Parsing xml using the .text() function in as3

I am accessing an xml document in actionscript, I know flash can see the xml as I am tracing it but when I add the .text() funtion to my trace to strip out the tags by trace doesn't see anything.
this works...
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseXML(xmlData);
function ParseXML(thexmlInput:XML):void {
trace("XML Output");
trace("------------------------");
trace(thexmlInput.wrapper.page);
this doesn't...
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseXML(xmlData);
function ParseXML(thexmlInput:XML):void {
trace("XML Output");
trace("------------------------");
trace(thexmlInput.wrapper.page.text());

The text() function returns an XMLList object, not a string literal.
To trace out the return of XML.text() - you need to loop through the object.
var xmlText:XMLList = myXML.text();
for each (var i:String in xmlText){
     trace(i);
Or you could use the toString() method instead.
trace(myXML.toString());
(The reason your first code works is because toString is automatically applied to trace statements, unless you specify something different)

Similar Messages

  • How can I use the "EvalScript()" function? I am trying to send text to a Director app from the web browser, but the console in the browser just responds "Uncaught ReferenceError: evalScript is not defined ".

    I am trying to control a Shockwave app form another machine, using "Pusher" service (websockets), and everything is ok so far; but when I try to send the shockwave app the text recieved from another machine, using the "EvalScript()" function (as documented), I only get the message "Uncaught ReferenceError: evalScript is not defined" in the browser's console. What am I doing wrong?
    'm using the following script in the webpage where the shockwave object is located:
      <script type="text/javascript">
        // Enable pusher logging - don't include this in production
        Pusher.log = function(message) {
          if (window.console && window.console.log) {
            window.console.log(message);
        var pusher = new Pusher('abc963cf3e6g678879e');
        var channel = pusher.subscribe('Galileo_channel');
        channel.bind('Galileo_event', function(data) {
          evalScript(data.message);
      alert(data.message);
      </script>
    The "alert" is working fine, but I can't get JavaScript to recognize the EvalScript (I even tried calling the shockwave object, ie: "extev01.evalScript()", since the object's ID is extev01, but it doesn't work, either).
    Help!

    Thanks Sean.
    I tried your suggestion first, using getNetText to poll the server and read a text file. The drawbak is that I had to poll the server constantly, since I could not know in advance when the text file was going to change (and it's not practical to stump the server and connection).
    I've kept trying the EvalScript, asigning the Shockwave object to a variable first, then calling the EvalScript() in the object, but it doesn't work, either. I think I will simply use JavaScript and forget about shockwave altogether, since everything is working fine up to that point (although it would be nice to be able to use Lingo for the rest of the app).

  • I sent in my iPhone 6 for repair. I used restore on the loaner phone I was given, and the contacts, texts, reminders, and Safari pages all showed up. My phone is back, and when I used the restore function again, those items are missing.

    I sent in my iPhone 6 for repair. I used restore on the loaner phone I was given, and the contacts, texts, reminders, and Safari pages all showed up. My phone is back, and when I used the restore function again, those items are missing. I do not use iCloud because I have no wifi at home, limited data available for regularly backing up, and I have a 64GB phone and don't wish to pay to upgrade from the 5GB iCloud storage. Am I doing something wrong? It worked so seamlessly on my loaner phone that I am completely stumped as to why it will not restore those items to my original phone again.

    The iphone is designed to be synced to your computer or cloud service.  Your contacts should be in whatever program/service you have chosen to sync.
    If you have failed to do this, then they are likely gone.

  • G'day, i am trying to type into an adobe document using the typewriter function. However everytime after i type the text vanishes. It is almost as if the text is white and vanishes into the background. However this is not the case as the works are not vis

    G'day,
    I need some help, i am trying to type into an adobe document using the typewriter function.
    However every time after i type the text vanishes. It is almost as if the text is white and vanishes into the background.
    This is not the case as the works are not visible regardless of the background color.
    The text box remains available and can be edited if clicked on, also if i double click on it the typed words become visible and editable, however once i close the box i cannot see them on the screen.
    I would appreciate any help i can get, i cant seem to do anything using properties or view.
    Thanks 
    Tiernan

    Hi Sara,
    See response to your questions below:
    1.     Are you running into this issue in a specific PDF, or in all of them?
    A.     All of them
    2.     What version of Acrobat are you using (and, are you on Mac OS or Windows?).
    A.     Using Acrobat 10.0\Acrobat on Windows
    3.     If you look at the text properties on the Tools panel (under Format), what color is the text swatch?
    A.     Test swatch for the text is black
    4.     What happens if you change the text color?
    A.     Nothing.
    I look forward to hearing back from you.

  • Lexical Parsing exception using JXQI for function in XQuery

    How to parse Xquery containing new declared namespace, functions and then use the same function to operate upon Xquery along with it.....
    When i try to execute that XQuery using JXQI library, i get lexical parsing exception.......
    i m quite new to XQuery and that too its implementation in java, so i would b grateful for the help in advance !!

    Hi,
    Could you post the XQuery, and a sample XML document (if necessary)?
    Thanks.

  • Using the ssIncludeXml function in Site Studio 10gR4

    Since the managed data file format has changed dramatically in Site Studio 10gR4, how do I still use ssIncludeXml to extract a particular element?
    For example, a data file in Site Studio 10gR3 looks similar to this:
    <region1>
    <PageBody>
    </PageBody>
    </region1>
    To extract the "PageBody" element I would use the ssIncludeXml function like this:
    ssIncludeXml(dDocName,"region1/PageBody/node()")
    In Site Studio 10gR4 a typical data file format looks like this:
    <wcm:root>
    <wcm:element name="PageBody">
    </wcm:element>
    </wcm:root>
    How do I use the ssIncludeXml function to match the "PageBody" here?
    Thanks!

    I'm trying to do this in Site Studio 11g and am having zero luck. I have an HCSP in Site Studio [which I am using to write XML] that is querying the system and returning a set of XML data files. In my HSCP, I have
    <link><!--$$ssIncludeXml(dDocName, "wcm:root/wcm:element\[@name='url'\]/text()")--></link>
    The XML documents' format is
    <wcm:root version="8.0.0.0">
    <wcm:element name="metadata"/>
    <wcm:element name="url">http://www.cnn.com</wcm:element>
    <wcm:element name="thumbnail"><img src="/cs/groups/internal/documents/digitalmedia/mdaw/mdex/~edisp/cf_12_831_ivolunteers_3_.jpg" alt="ivolunteers" /></wcm:element>
    <wcm:element name="text">This is my link text</wcm:element></wcm:root>
    When I run this, however, I get nothing returned (no errors either).
    Frustration! :) Any ideas?

  • Importing/Parsing XML using SQL and/or PL/SQL

    What is the recomended way of importing/parsing XML data using SQL and/or PL/SQL?
    I have an XSD that defines the structure of the file, and an XML file that has the content in the appropriate structure. I have parsed (checked) the structure of the XML file using JDOM in my java application, and then passed it to a function in a package on the database as a CLOB.
    What I need to do is parse the contents of the XML file that is passed into the function and extract the values of each XML element so that I can then do some appropriate validation before inserting and committing the data to the database (hence completing the import function).
    A DBA colleague of mine has been experimenting with various ways of acheiving this, but has encountered a number of problems along the way, one of which being that he thinks that it is not possible to parse XML elements that are nested more than four levels deep - is this the case?
    The structure of the XSD/XML that the database function needs to manipulate and import data from is very complex (and recursive by it's nature).
    I would appreciate any suggestions as to how I can achieve the above in the most efficient manner.
    Thanks in advance for your help
    David

    This is the forum for the SQLDeveloper tool. You will get better answers in the SQL and PL/SQL forum, and especially the XML DB forum.
    Oracle has comprehensive and varied support for XML, including a PL/SQL parser.

  • How to use the pps function from JCOP?

    Hi
    I'm trying to use the pps function from JCTerminal (JCOP API: [url http://www.cs.ru.nl/~woj/jcopapi/com/ibm/jc/JCTerminal.html#pps(int, int)]pps function ) to connect my client to a virtual card with a specific protocol (T=0).
    But I always got the error: "Protocol and parameter selection not supported by this terminal!"
    I've tried to make an ATR that support both protocol : [url http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc]3B 90 95 80 81 1F C7 DC.
    I really don't know what value to put in the second parameter (baud rate), I've tried with 150000, which is in the range of the ATR but I'm not sure this is correct. And I could't find any example of it.
    I'm also not sure where to put the pps command, the specification say directly after a reset, so I tried this implementation:
    System.out.print("Start");
              readers = TerminalFactory.getDefault().terminals().list(State.CARD_PRESENT);
              //If no readers has a card it ends the process
              if(readers.isEmpty()){
                   System.out.println("\nNo card in the reader...");
                   return;
              System.out.println("\nReader Type: "+readers.get(0).toString());
              term = (PCSCJCTerminal)JCTerminal.getInstance("PCSC", readers.get(0).toString().substring(15));
              term.open();
              System.out.println("\nTerminal opened");
              //Getting the ATR
              atr = new ATR(term.waitForCard(2000));
              try {
                   term.pps(JCTerminal.PROTOCOL_T0, (int)150000);
              } catch (Exception e) {
                   e.printStackTrace();
              System.out.println("ATR: "+toHex(atr.getBytes()));
              //sending a data 11223344
              System.out.println("\nsending data: 11223344");
              byte[] responsesend = term.send(0,cmdsend,0,cmdsend.length);
              System.out.println("Response data is:" + toHex(responsesend));
              //close terminal
              term.close();
              System.out.println("\nTerminal closed");I've got this output on the console:
    <font size="2">StartReader Type: PC/SC terminal Virtual CAD Reader 0
    Terminal opened
    ATR: 3b 90 95 90 00 81 1f c7 cc
    sending data: 11223344
    <font color="red">Protocol and parameter selection not supported by this terminal!</font>
         at com.ibm.jc.JCTerminal.pps(Unknown Source)
         at com.test.essai.main(essai.java:46)
    </font>>
    And If I take a look at the data exchanged with the card:
    <font size="2">Running in Virtual Card mode...
    ATR: 3B909580811FC7DC
    Waiting for event (power: off, protocol: unknown/undefined)...
    Waiting for event (power: off, protocol: unknown/undefined)...
    Raw event data: 01
    Event: VCAD_EC_POWER_ON (0x01)
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_POWER_ON) ATR: 3b909580811fc7dc
    Raw reply data: 003b909580811fc7dc
    Sending reply...
    Waiting for event (power: on, protocol: unknown/undefined)...
    Waiting for event (power: on, protocol: unknown/undefined)...
    Raw event data: 06ff11957b
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: ff11957b
    Accepting any PPS request parameters: Protocol: t=1; FI=9, DI=5
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: ff11957b
    Raw reply data: 00ff11957b
    Sending reply...
    </font>>
    This (above) is the PPS command but not from the PPS function, it is always sent with protocol T=1
    <font size="2">Waiting for event (power: on, protocol: t=1)...
    Raw event data: 0501
    Event: VCAD_EC_SET_PROTOCOL (0x05) Protocol: t=1
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_SET_PROTOCOL)
    Raw reply data: 00
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 0600c10120e0
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 00c10120e0
    Handling protocol-specific command...
    Protocol block:
    NAD: 0x00
    PCB: 0xc1 (T1_S_BLOCK); S-Block type: T1_SBT_IFS_REQ
    LEN: 1
    INF:
    IFS: 20
    EDC: 0xe0
    Changing IFS(other) from 32 to 32
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 00e10120c0
    Raw reply data: 0000e10120c0
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 0600001300a404000d54657374436c69656e7441707000f0
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 00001300a404000d54657374436c69656e74
    41707000f0
    Processing app. command...
    App. block:
    NAD: 0x00
    PCB: 0x00 (T1_I_BLOCK); Seq. #: 0; More data: 0
    LEN: 13
    INF:
    00a404000d54657374436c69656e7441707000
    EDC: 0xf0
    cmd name: N/A (class #4)
    cmd: 00a40400 0d 54657374436c69656e74417070 70
    Responding with the reversed command data, SW is hardcoded to 90<INS>
    rsp: 707041746e65696c4374736554 90a4
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 00000f70704
    1746e65696c437473655490a475
    Raw reply data: 0000000f707041746e65696c437473655490a475
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 060040041122334400
    Event: VCAD_EC_EXCHANGE_TPDU (0x06) C-TPDU: 0040041122334400
    Processing app. command...
    App. block:
    NAD: 0x00
    PCB: 0x40 (T1_I_BLOCK); Seq. #: 1; More data: 0
    LEN: 4
    INF:
    11223344
    EDC: 0x00
    cmd name: N/A (class #1)
    cmd: 11223344
    Responding with the reversed command data, SW is hardcoded to 90<INS>
    rsp: 9022
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_EXCHANGE_TPDU) R-TPDU: 0040029022f
    0
    Raw reply data: 000040029022f0
    Sending reply...
    Waiting for event (power: on, protocol: t=1)...
    Raw event data: 03
    Event: VCAD_EC_POWER_OFF (0x03)
    Reply: VCAD_SC_OK (0x00) (in reply to VCAD_EC_POWER_OFF)
    Raw reply data: 00
    Sending reply...
    Waiting for event (power: off, protocol: unknown/undefined)...
    </font>>
    If someone know how to use this function or have any advice to help me to select a specific protocol with Jcop API, please let me know.
    If you you need any more information don't hesitate to ask.
    Best regards
    Edited by: Cyril on Sep 22, 2011 9:54 AM

    -1
    I'm using a virtual terminal (windows driver), and I don't see how I could turn off the Auto-pps. I've also tried with a real reader and a card and I have the same error.
    -2
    I've tried value in the range of the atr (based on this analysis: [url http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc]http://smartcard-atr.appspot.com/parse?ATR=3b909580811fc7dc ). But I don't know if only I value of baud-rate is possible in the range. Anyway I just would like to change the protocol, not the baud-rate.
    -3
    I've already tried to call pps function before, after the first reset, or with another reset later and I always got the same thing.
              term = (PCSCJCTerminal)JCTerminal.getInstance("PCSC", readers.get(0).toString().substring(15));
              term.open();
              System.out.println("\nTerminal opened");
              //Getting the ATR
              atr = new ATR(term.waitForCard(2000));
              System.out.println("ATR: "+toHex(atr.getBytes()));
              jcard = new JCard(term,atr,0);
              jcard.reset();          
              try {
                   term.pps(JCTerminal.PROTOCOL_T0, (int)312500);
              } catch (Exception e) {
                   e.printStackTrace();
              }The same pps is always send after each reset...

  • Using the IF function with a range of numbers

    I am working with the IF function and trying to get it to work "if" the number I'm examining is within a range of numbers.
    Example:
    If a wigit costs between $1000 and $1999, then a discount of $100 is given
    If a wigit costs between $2000 and $2999, then a discount of $150 is given
    If a wigit costs between $3000 and $3999, then a discount of $225 is given
    And so on.
    If cell A1 always holds the current cost of the wigit being sold.
    cell B1,B2,B3 holds the value of the discount values respectively.
    In cell C1 I would like to return what the current discount value is to be given for the wigit price in cell A1?
    How do I do this using the IF function or is there another way?
    Thanks,
    Ryan

    HI Ryan,
    In this post you have, except for the issue noted by Badunit, the basis for the discount table described by Wayne:
    I'm trying to devise a way of knowing what Cash Card a customer will receive depending on the amount of the purchase, based on the following table:
    $0         to $999 purchase         =      $50 Cash Card
    $1,000 to $1,999 purchase     =     $100 Cash Card
    $2,000 to $2,999 purchase      =     $200 Cash Card
    $3,000 to $3,999 purchase      =      $300 Cash Card
    $4,000 to $4,999 purchase      =      $400 Cash Card
    $5,000 to $5,999 purchase      =     $550 Cash Card
    $6,000 to $6,999 purchase     =      $700 Cash Card
    $7,000 to $7,999 purchase      =     $850 Cash Card
    $8,000 to $8,999 purchase     =      $1,000 Cash Card
    $9,000 to $9,999 purchase     =     $1,200 Cash Card
    $10,000 to   UP   purchase     =     $1,500 Cash Card 
    To take care of the issue noted by Badunit, you need to revise the top line to state the minimum purchase necessary to earn a cash card, then add a line above that to handle purchases under that amount. I've arbitrarily chosen a $500 minimum, which results in these two lines:
    $0             to $499 purchase        =      $0 Cash Card
    $500         to $999 purchase         =      $50 Cash Card
    To write this as Wayne's table, you need to remove all of the text (including the $ currency markers), the top end of each range, and the = sign. What you're left with is two columns of numbers: The bottom number of each range of values, and the number telling the dollar amount of the cash card for that range. Here's your table, edited to make it work with LOOKUP:
    Here is a second table (Main), containing only the labels and the two cells involved in the calculation of the cash card amount. The Purchase amount is the amount used in your example. The Cash Card amount is produced by the LOOKUP formula below the image.
    Purchase price is in cell B1 of the table "Main". The LOOKUP formula is in B2:
    B2: =LOOKUP(B1,CC Amt :: A,CC Amt :: B)
    LOOKUP acts essentially as you request in your post containing the iPad image with the time shown as 1:46. But it takes a much simpler approach.
    Here's the syntax:
    LOOKUP(search-for,search-where,return-from)
    LOOKUP gets the search-for value (2535) from cell B1.
    It looks in column A of the table "CC Amt" for the largest value less than or equal to the search-for value, and finds 2000.
    It returns the value from the same line of column B (200).
    Below are two more examples. Main-2 and Main-3 are copies of the Main table. Both contain exactly the same formula as Main, but have had a different Purchase price amount entered. LOOKUP uses the same CC Amt table as is used above, and returns the appropriate Cash Card value for each of the two new amounts:
    You may, as implied in your 1:46 post, use a pair of cells to calculate the Cash Card amount for each widget in the purchase, then total the Cash Card amounts, or you may use a single pair of cells, one containing the total purchase amount, the other containing the Cash Card amount due for that total. That choice is yours. The formula is the same for either case.
    Regards,
    Barry

  • Error using the XPath function id()

    I am using BDBXML 2.2.13. When I submit the following query the execution fails because of the following failed assertion on line 681 of DbXmlNodeImpl.cpp.
    collection('test.dbxml')id(/site/people/person[@id='person1']/watches/watch/@open_auction)
    DBXML_ASSERT(nt->getInterface(DbXmlNodeTest::gDbXml) != 0);
    The failure does not happen if the arguments passed to id are constant, for example the following query works just fine:
    collection('test.dbxml')id('person0')/name
    The problem seems to be that the function arguments are represented by Pathan objects instead of DbXml objects that are cast back and forth when using the different interfaces.
    Is this a know bug in the database or is my query not properly formated?

    DB XML 2.2.13 is quite old now. Does that same problem occur with DB XML 2.3.10?
    Using the id() function is not going to do what you want it to anyhow, since DB XML does not provide typing information for the XML tree. You'll need to use conventional navigation to get the node that you want.
    John

  • Using the "Find" function in RoboHelp 9.0.1.262

    I'm using RoboHelp 9.0.1.262. Is it possible to use the "Find" function to find text in an entire project? I have only been able to use it to find text in individual topics within the project. This would be very inconvenient to have to go to each topic to do the search.

    I'm not sure I would quite agree with saying the RH Find and Replace is lame or that FAR is just another text editor.
    The RoboHelp Multi File Find and Replace has a serious limitation but it is one that is common. Most text editors do not search across multiple lines as I said.
    FAR is not something I would regard as a text editor, more a compilation of authoring tools. Just today it save me a whole lot of work by being able to extract an HHC file from a CHM so that I could then get it into a RoboHelp project I had inherited with a wrecked TOC.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Any description on how to use the Text Editor used for this Forum?

    I am very frustrated when trying to use the text Editing functions (without use of HTML, that I do not undertstand) that can be used to create Posts in this Forum .
    Can somebody point me to a good description of the Text Editor used to enter/edit Posts in this Forum? Thanks a lot in advance.

    Ian,
    Thank You very much for your answer.
    Based on your answer, I guess and fear, that there exist no "user guide" for this Text Editor.
    I will wait a little bit more to see whether I get more information/answers. If not, i will probably write a "Feature Request" to request that Adobe provides us or point us to a reasonable User-Guide for this Text Editor.

  • When using the text to speech which vtml_speed value is the best?

    When using the text to speech function along with the VTML tag for speech (<vtml_speed>) what number provides the best rate for learning. I am currently trying to use this function to improve my computor generated speech for a project. I have been getting complaints that it is too slow, yet the default setting is too fast. Any advice out there?

    Hopefully nothing serious. Try a Safe Mode boot ...
    A Safe Mode boot takes a longer than a normal boot so be patient.
    Once you are in Safe Mode, click Restart from the Apple () menu.

  • Why am I unable to use the text message feature on my Honda CRV with my iphone 6?

    Am I unable to use the text messaging feature on my 2014 Honda CRV with my Iphone 6?

    mspacmn wrote:
    Am I unable to use the text messaging feature on my 2014 Honda CRV with my Iphone 6?
    Yes, you are unable to use text messaging feature with your iPhone.
    -> http://owners.honda.com/vehicles/information/2014/CR-V/features/SMS-Text-Message -Function/3
    "The system is currently compatible with select Blackberry® phones with Bluetooth"

  • Which situation should we use the text item with the item category TATX

    Dear experts!
    Thank you for your attention!
    I am confused with text item (TATX).
    which situation should we use the text item with the item category TATX????
    Someone told me that the text item is dummy and should be used as a manual of certain standard item. But the manual may be a book or several papers and it also takes up some inventory not a dummy.
    So, could some body tell me what the text item (TATX) exact is and what function it has.
    Best regard!
    Tangdark

    Hi,
    you can use TATX if you like to enter a text and to print some information between the item lines.
    Regards
    William

Maybe you are looking for

  • Can i edit slideShow size?

    when i go to view a thumbnail and it opens the picture up the window covers my whole screen (23inch) and my pic is only like 500 pixels. is there a way to resize the slide show window so it fits perfect around my pic. or will i have to open the slide

  • Really interesting bug with Compiz, not sure how to label it

    Hi forums, I really promise I searched around for this, so if this is a super common bug, I apologize in advance (I really wasn't sure how to even label what was happening). All I know is that when compiz is enabled, I'm getting super weird behavior

  • I-pod not accessible in I-tunes

    Well this is a rather random question. i plug my 120G i-pod classic into my MAC, and i-tunes comes up, everything works great, i can sync it with computer just fine... but when the i-pod shows up in the "device" section on the left side of itunes scr

  • JSP, BEANS AND DAO best practice... (and a little of STRUTS & JSTL)

    Hi, Want to get your opinion on how to really use bean and dao in jsp pages. Imagine that you wants to display a news list on the jsp index page for example. You've got a dao with method getLastNews(int size) which returns a Collection of News beans.

  • Firefox Android Locks Up Samsung GS5

    Cant stop Firefox Android from stopping working or freezing up on my Samsung GS5. Sometimes it hangs so hard i have to remove the battery to reboot my phone. Never had problems with my GS3 or my Tab2 devices. But galaxy S5 just hated this browser. I'