Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    js-shell / firefox behave differently

    Hello all.
    I am using the xml2array script to parse some xml. The problem is, that everything works perfectly when I test it using this page -- http://www.squarefree.com/shell/shell.html , but the behavior changes when I use it in localhost. I'm using Firefox 3.0.3.

    For instance, for a simple XML like this --
    Code:
    <?xml version='1.0'?>
    <methodResponse>
    <params>
    <param>
    <value><int>3485</int></value>
    </param>
    </params>
    </methodResponse>
    output inside the JavaScript shell I mentioned before is 3485 (output['int']) , but the same expression (output['int']) evaluates to "methodResponse" while using in localhost. I've tried using different expressions to extract out the value, with no success so far.
    Any help? Thanks a lot.

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    did you try output.methodResponse.params.param.int?
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    why didn't i try that. thanks!

    btw, why is there this difference in behaviour?

  • #4
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    Quote Originally Posted by siddhant View Post
    btw, why is there this difference in behaviour?
    perhaps you'll find the answer if you dig deep into xml2array library...i myself am mystified why output.methodResponse.params.param.int works and not output.methodResponse.params.param.value.int since the int node is a child of the value node...the answer may lie in the documentation...but, i'm too lazy to look :/
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •