Menu

How to creating multiple elements

nku
2011-03-21
2012-07-04
  • nku

    nku - 2011-03-21

    Hi All, I tried using the APIs exposed. The problem is that I need to be able
    to create an exi representation of the XML of the following format
    <EL1><EL2><id>123</id></EL2><EL2><id>345</id></EL2></EL1>. I did that using
    APIs in the following order:

    1. StartDocumentSer().

    2. StartElemetSer( for EL1 )

    3. StartElementSer( for EL2)

    4. Then add the elements and data for id, closed "id" element. Then close EL2

    5. StarElementSer( for EL2) again.

    it core dumps at this point. The apis do not allow me to add the same tags
    more than once. In this example, the apis do not work when I add EL2 twice
    within EL1 tag.

    Am I using the APIs correctly ? Or is this because of a known bug ?

    Thanks,

    Naren

     
  • Rumen Kyusakov

    Rumen Kyusakov - 2011-03-21

    Hi,

    this is a bug we discovered recently. It should be fixed in the last revision
    (83) from the SVN.

    There are also a number of other issues in the first release so please use the
    code from the SVN until we release the next version expected in few weeks.

    If the problem persists, please let me know.

    Regards,

    Rumen

     
  • nku

    nku - 2011-03-22

    Hi Rumen,

    Thanks for the reply. I got the latest revision from svn. This is the code I
    changed in the examples encoder, encodeTestEXI.c

    tmp_err_code += asciiToString("0.1", &chVal, &testStrm.memList, FALSE);

    tmp_err_code += serEXI.stringDataSer(&testStrm, chVal);

    tmp_err_code += asciiToString("", &uri, &testStrm.memList, FALSE);

    tmp_err_code += asciiToString("EC2", &ln, &testStrm.memList, FALSE);

    tmp_err_code += serEXI.startElementSer(&testStrm, qname);

    tmp_err_code += asciiToString("This is an example of serializing EXI streams
    using EXIP low level API", &chVal, &testStrm.memList, FALSE);

    tmp_err_code += serEXI.stringDataSer(&testStrm, chVal);

    tmp_err_code += serEXI.endElementSer(&testStrm);

    tmp_err_code += asciiToString("", &uri, &testStrm.memList, FALSE);

    tmp_err_code += asciiToString("EC2", &ln, &testStrm.memList, FALSE);

    tmp_err_code += serEXI.startElementSer(&testStrm, qname);

    tmp_err_code += asciiToString("This is an example of serializing EXI streams
    using EXIP low level API", &chVal, &testStrm.memList, FALSE);

    tmp_err_code += serEXI.stringDataSer(&testStrm, chVal);

    tmp_err_code += serEXI.endElementSer(&testStrm);

    tmp_err_code += serEXI.endElementSer(&testStrm);

    tmp_err_code += serEXI.endDocumentSer(&testStrm);

    This is to create two EC2 elements. Is this the right usage of the APIs to get
    the desired effect ? The encoding program went fine. But when I tried decoding
    the exi that was generated, it threw an error: 10: Fatal Error: Error
    processing next production.

    Any pointers please ?

    Thanks,

    Naren

     
  • Rumen Kyusakov

    Rumen Kyusakov - 2011-03-22

    Hi Naren,

    Thank you for your feedback!

    The serialization is quite unstable due to lack of good unit test coverage. We
    are currently working on that. Anyway, this bug should be fixed now in the SVN
    trunk. Another issue you might experience is if you add attributes to EC2
    elements. Multiple occurrences of elements with attributes causes some
    problems right now. This also will be fixed very soon.

    Regards,

    Rumen

     
  • nku

    nku - 2011-03-23

    Hi Rumen,

    Thanks for the mail and the fix. It works now.. I mean the multiple elements.
    As you said, when I used attributes, then, only the first occurrence has the
    attribute and the later occurrences of the elements EC2 do not seem to have
    them. Please let us know when the attributes bug is also fixed, we will
    definetely be needing that. Whenever I find some problems, I will surely put
    them on the forum. Hoping that this will help.

    Thanks again.

    Regards,

    Naren

     
  • Rumen Kyusakov

    Rumen Kyusakov - 2011-03-24

    Hi Naren,

    The multiple attribute occurrences bug should be fixed now. We appreciate any
    feedback and bug reports so please do report any problems you experience - it
    help us make EXIP better.

    It might be also a good idea to use the Bug Tracker facility of the project (
    Projects > EXIP > Tracker > Bugs ). It is easier to keep track of the issues
    that needs to be fixed that way.

    Regards,

    Rumen

     
  • nku

    nku - 2011-03-24

    Hi Rumen,

    Great.. !! I just checked that out and it works beautifully. I will make sure
    that I log the bugs using the bug tracker.. it is definetely easier to see
    what is fixed in the release too..

    Thanks again. In the next few days I will be using and testing it out. Will
    report if any.

    Regards,

    Naren

     

Anonymous
Anonymous

Add attachments
Cancel