Customer Portal

Need assistance in Templates for nested/recursive data

Comments 4

  • Avatar
    slechtaj
    0
    Comment actions Permalink
    Hi,

    Could you please specify what you expect on output?
    Also is there any chance to obtain these categories with some unique Ids?

    Thanks,
  • Avatar
    madan_clover3
    0
    Comment actions Permalink
    Hi, I was trying to convert above json to xml, with expected output is

    <category>
    <name>cat1</name>
    <subcategory>
    <name>subcat1</name>
    <category>
    <name>cat2</name>
    <subCategory>
    <name>subcat2</name>
    </subCategory>
    </category>
    </subcategory>
    </category>

    Categories does not have unique ids, but can be combined with parent category name to make it unique.
  • Avatar
    slechtaj
    0
    Comment actions Permalink
    Hi Madan,

    usually this would be done by two our components:


    Unfortunately there is an issue in XMLWriter that does not allow us to write recursive structures into XML. For more information, please refer to: https://bug.javlin.eu/browse/CLO-3952

    A workaround for this issue might be replacing JSON structure with XML structure using regular expressions. I have created an example for you, so that you can see how that might be handled in CTL language.

    Hope this helps.
  • Avatar
    madan_clover3
    0
    Comment actions Permalink
    Thank you very much for you time and support. Will give a try with your example.

Please sign in to leave a comment.