Menu

how to encode and decode xsi:type?

Get Help
2012-12-05
2013-05-31
  • Sravana Kumar K

    Sravana Kumar K - 2012-12-05

    Hi,
    In my XML I have xsi:type attribute is there. But, I am not able to encode that.
    Can anybody help me in this?
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    so, xsi:type =>
    uri is "http://www.w3.org/2001/XMLSchema-instance"
    localName is type

    This is how I am filling my qname.

    Thanks,
    SK

     
  • Rumen Kyusakov

    Rumen Kyusakov - 2012-12-05

    Hi Kumar,

    Your approach of constructing the qname for xsi:type is correct.
    Looking at the issue I realized that the encoding of xsi:type attributes is not implemented yet. It is just the parsing of xsi:type that is available in exip.

    The reason is because the EXI data type for the value of xsi:type is QNAME indicating the type that will be used for the element.
    Currently, there is no errorCode qnameData(EXIStream* strm, QName qname); in EXISerializer.h

    It will be added as feature request.

    Regards,
    Rumen

     
  • Sravana Kumar K

    Sravana Kumar K - 2012-12-05

    Thanks Rumen for the response.

    I have run the clokwork on EXIP code. I got couple of warnings in that. Few of them I fixed like NULL check, memery free kind of, Once I finish all those changes, I'll share the changes.

    If you don't mind, may I know when'll you release the code with this feature?

    Thanks,
    SK

     
  • Rumen Kyusakov

    Rumen Kyusakov - 2012-12-05

    I am working on very big changes to the source code that will make the footprint of the code a lot smaller and also require a lot less memory.

    Unfortunately I am working on exip just 10% of my time now as I have a lot of other things to do.

    Expected time for the next release is February 2013.

    Regards,
    Rumen

     
  • Sravana Kumar K

    Sravana Kumar K - 2013-01-03

    Hi Rumen,
    Wish you a happy new year.

    If you worked on xsi:type. Can you please share the patch? then I'll try to test. If I see any issues I'll try to figure it out.

    Once everything is stable, then you can release.

    Right now, I am blocking with xsi:type.

    Thanks,
    SK

     
  • Rumen Kyusakov

    Rumen Kyusakov - 2013-01-09

    Happy new year!

    I am still not ready with the code re-factoring. I need to finish that before I can fix the xsi:type issue.
    The code in the repository barely compiles now - it needs a lot more work to get to the point where it was before in terms of features.

    Regards,
    Rumen

     
  • Chris Leclercq

    Chris Leclercq - 2013-01-31

    Hi Rumen, I would also be interested in testing a fix for xsi:type whenever you have it available.

    Regards,
    Chris

     
  • Rumen Kyusakov

    Rumen Kyusakov - 2013-02-01

    Hello Chris, Kumar,

    I am almost ready with the refactoring - there are still several unit tests that fail and few more thing to get fixed, but I plan to put the

    errorCode qnameData(EXIStream* strm, QName qname);
    

    function next week and let you know when you can do some testing on the xsi:type use case.
    It will be very helpful to have your feedback even before the release - that will speedup the process.

    Best regards,
    Rumen

     
  • Sravana Kumar K

    Sravana Kumar K - 2013-02-07

    Hi Rumen,

    Good to know that the status of xsi:type.

    I am ready with my test cases for xsi:type. I am waiting for your code release.

    Once you released the code, then I'll start my testing and update you.

    Thanks,
    SK

     
  • Rumen Kyusakov

    Rumen Kyusakov - 2013-02-07

    Hi,

    The latest code in the SVN repo has the xsi:type feature implemented. You can check it out and test if it works for your use case.
    For some reason the link to the repo is messed-up in the Code section - I have to contact the SF guys for that - use this instead:
    https://exip.svn.sourceforge.net/svnroot/exip

    Note that it is only tested for schema-less encoding - you can have a look at the unit test in trunk/tests/check_xsi_type.c for more information on the usage.

    Any additional use-cases (such as schema strict and non-strict mode) added to check_xsi_type.c will be highly appreciated especially if you find issues.

    Regards,
    Rumen

     
  • Sravana Kumar K

    Sravana Kumar K - 2013-02-13

    Hi Rumen,

    I have tested my code with new library. Encoding is working fine it seems.

    I made one change as below.
    ../../src/grammarGen/src/genUtils.c:219: addProductionsToARule: Assertion `FALSE' failed.

    I have commented that line, then encoding is working.

    I guess, you didn't add decoding part of xsi:type.

    I didn't see any code related to qname decoding.

    Correct me If I am wrong.

    I try to do few more test cases. If i find any issues, I'll update you.

    If possible, can you share me the xsi:type decoding part.

    Thanks,
    SK

     
  • Rumen Kyusakov

    Rumen Kyusakov - 2013-02-13

    Hi,

    You're right, I forgot to add the handler for the decoding part. I was wondering if a should reuse the string handler for the xsi:type value but now I added qname handler. You can update your code - the assertion should also be fixed now.

    The only thing left is the issue with xsi:type when Preserve.lexicalValues is true but that is to be solved later.

    Regards,
    Rumen

     
  • Denis Froschauer

    Hi everybody,

    Has someone written an example of using xsi:type in schema-informed mode ?

    Regards
    Denis

     
  • Denis Froschauer

    I modified check_xsi_type.c to test xsi:type in schema informed mode.
    The encoding and parsing return no error, but the xsi:type attribute is not present in the parsing.
    (note that in schemaless mode, same code, the xsi:type attribute is present)

    Note : I use svn release 276

     

    Last edit: Denis Froschauer 2013-05-26
  • Denis Froschauer

    Update : save behavior with release 287

     
  • Rumen Kyusakov

    Rumen Kyusakov - 2013-05-27

    Hi Denis,

    Can you commit the new test case (best if it is a separate and not replacing the old one for schemaless) so I can have a look?

    Best regards,
    Rumen

     
  • Denis Froschauer

    Done : r288
    Regards
    Denis

     
  • Rumen Kyusakov

    Rumen Kyusakov - 2013-05-30

    Thanks!

    The test case is integrated and the bug fixed in trunk.
    It was just that the AT callback handler was not called in that particular case

    Best,
    Rumen

     
  • Anonymous

    Anonymous - 2013-05-31

    Well done ! Trunk r289 corrects the issue.
    Denis

     

Anonymous
Anonymous

Add attachments
Cancel