Best way to use/keep XML data from file

Discussion in 'ASP .Net' started by phl, May 3, 2006.

  1. phl

    phl Guest

    Hi,

    I have some data in an xml file which I need to use in my web form. The
    data in the xml file needs to be shown in maybe a repeater, grid or
    data control. I will need to parse the data make sense of it and maybe
    place it in a data structure. Once I have a meaningful representation
    of this data(the format is not exactly how i want it), I would like to
    cache it. This data does not change often. So my questions are:

    - Would it be easier to write code to parse xml or transform it?
    - Is is efficient to hold this data in a dataset/datatable or some kind
    of XML object and keep it in application cache?

    thanks

    phl
    phl, May 3, 2006
    #1
    1. Advertising

  2. phl

    Rajesh CKR Guest

    In our applications we usually do the following -

    class Utility
    {

    // You may want to consider strongly typed Generic List if you are using
    ASP.Net 2.0
    static ArrayList xmlData; //contains objects from XML...

    static Utility()
    {
    //Parse the xml file here and put it into a structure which you can
    iterate....
    loadAndParseXML();
    }
    }


    The static constructor will be called only once and you can expect xmlData
    variable to contain the relavent data when required.

    Also object in MyXMLData can expose properties so that you can bind on
    repeters, datagrids etc. Since you
    can write your own logics for Get methodes and also extra properties if
    required, this method has an edge over
    dataTable or dataset (Still can be done by adding more columns to tables..
    but not all that neat)

    HTH

    Rajesh CKR


    "phl" <> wrote in message
    news:...
    > Hi,
    >
    > I have some data in an xml file which I need to use in my web form. The
    > data in the xml file needs to be shown in maybe a repeater, grid or
    > data control. I will need to parse the data make sense of it and maybe
    > place it in a data structure. Once I have a meaningful representation
    > of this data(the format is not exactly how i want it), I would like to
    > cache it. This data does not change often. So my questions are:
    >
    > - Would it be easier to write code to parse xml or transform it?
    > - Is is efficient to hold this data in a dataset/datatable or some kind
    > of XML object and keep it in application cache?
    >
    > thanks
    >
    > phl
    >
    Rajesh CKR, May 3, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruce W..1

    Best way to keep a hidden value?

    Bruce W..1, Dec 9, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    465
    Scott M.
    Dec 10, 2003
  2. Bucco
    Replies:
    3
    Views:
    443
    Volkm@r
    Jul 22, 2005
  3. Ariana
    Replies:
    2
    Views:
    413
    Ariana
    May 3, 2006
  4. =?Utf-8?B?cGF0cmlja2RyZA==?=

    best way to keep persistence of a dataset?

    =?Utf-8?B?cGF0cmlja2RyZA==?=, Feb 1, 2007, in forum: ASP .Net
    Replies:
    7
    Views:
    519
    MasterGaurav \(www.edujini-labs.com\)
    Mar 1, 2007
  5. Edward J. Stembler

    Best way to keep track of user-related info? [Opinions wanted]

    Edward J. Stembler, Nov 13, 2003, in forum: ASP .Net Security
    Replies:
    1
    Views:
    117
    Edward J. Stembler
    Nov 13, 2003
Loading...

Share This Page