×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    4

    widget using local xml file

    Hi ,
    Can i create a widget which uses an xml file whch is already present in the mobile?? If so how to load that particular xml file to parse the data.

  2. #2
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    60

    Re: widget using local xml file

    Quote Originally Posted by swetha_t View Post
    Hi ,
    Can i create a widget which uses an xml file whch is already present in the mobile?? If so how to load that particular xml file to parse the data.
    If it was possible then it would be possible using XMLHttpRequest to a file:/// URL, but I doubt very much that it is possible. What I would do instead, however, is to use JSON and load it simply by pointing a script src at it. That also saves you the parsing trouble.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    4

    Re: widget using local xml file

    Thank You for your response peppe,
    The solution you have specified is to use JSON instead of XML,but iam facing a problem when iam trying to load a file which is already present in my mobile.Iam using the following code(javascript)

    function fetch() {


    var DetailsDoc=document.implementation.createDocument("", "doc", null);


    if(DetailsDoc!=null)
    {
    DetailsDoc.async = false;

    DetailsDoc.load("file://c:\\details.xml");

    }

    }

    tha API "load" is supporting in a normal browser in desktop,it is giving problem when iam using the same code for browser in S60 mobile.Is it some problem related to browser capabilities to load a file??
    Is there any other way to load the file?
    Last edited by swetha_t; 2008-05-30 at 06:40.

  4. #4
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    60

    Re: widget using local xml file

    The issue you have is because load() is not implemented in WebKit.

    JSON doesn't require accessing a remote server - it is a notation format for specifying objects in JavaScript, including complex object hierarchies (such as a DOM tree of an XML document). You can load JavaScript locally using a simple <script> tag that you dynamically insert into the HTML document and thus you can also load JSON data. That's why JSON sidesteps the issues you have with load(). It also has the added benefit that you don't need to parse anything.

Similar Threads

  1. Replies: 8
    Last Post: 2008-02-29, 13:32
  2. Error with makesis.exe and creating the .pkg file
    By gramya87 in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2007-10-10, 13:53
  3. generating an XML file..
    By mayankkedia in forum Symbian
    Replies: 0
    Last Post: 2007-01-10, 15:42
  4. Replies: 3
    Last Post: 2006-12-20, 12:54
  5. Sending XML file from server to mobile
    By bvsbh in forum Mobile Java General
    Replies: 1
    Last Post: 2005-11-30, 15:21

Posting Permissions

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