×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    5

    Lightbulb Create XML using CSen* classes

    Hello,

    I'm building an application that reads the data from XML files. I was able to parse XML file using CSen* classes, but I couldn't find any resources regarding how to do it the other way around, ie. having the data create whole CSenDomFragment structure and then write it to a file. Something like this (pseudocode):

    iRoot->AddElement("Element1", "TestTest");
    iRoot->AddElement("Element2", "TestTest2");

    How to do it? I tried NewL constructor with link to a parent Node, but, as for the moment, it's failing.

    iChild = CSenDomFragment::NewL([...], iRoot->AsElement())

    Thanks,
    Łukasz.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Create XML using CSen* classes

    Check the AsXmlL methods.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    5

    Re: Create XML using CSen* classes

    I ment: how to create whole XML tree using CSenDomFragment objects (and then project it onto a file or buffer as a fully qualified XML). I think it should look somthing like this:
    CSenDomFragment* root;
    root = CSenDomFragment::NewL(KRootNodeName());
    CSenDomFragment* node1;
    CSenDomFragment* node2;
    node1 = CSenDomFragment::NewL(KX1, KX2, KX3, attrArray, root->AsElementL()); // point to a parent object
    node2 = CSenDomFragment::NewL(KX1, KX2, KX3, attrArray, root->AsElementL()); // point to a parent object
    But it seems not to work, root->AsElementL().Elements() doesn't return any childs.

    Lukasz.

  4. #4
    Registered User
    Join Date
    Nov 2008
    Posts
    5

    Re: Create XML using CSen* classes

    Code below is the right way. I will have to figure out how to set content and attributes.
    root = CSenDomFragment::NewL(KTest1());
    root->AsElement().AddElementL(KTest1());
    root->AsElement().AddElementL(KTest2());

    Lukasz.

Similar Threads

  1. XML
    By manish.garg in forum Symbian
    Replies: 7
    Last Post: 2008-12-01, 07:38
  2. Can u create a virtual directory in J2ME
    By CSFYPMAIL in forum Mobile Java General
    Replies: 2
    Last Post: 2008-11-22, 17:51
  3. How to Create a form dynamically using xml or anthing?
    By sasikumar31 in forum Mobile Java General
    Replies: 2
    Last Post: 2008-01-13, 11:16
  4. Replies: 10
    Last Post: 2007-07-02, 06:28
  5. The following classes and resources could not be loaded ERROR!!
    By keithgardiner in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2007-02-01, 20:03

Posting Permissions

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