Topic
6 replies Latest Post - ‏2013-06-11T16:43:15Z by NiladriChakraborty
NiladriChakraborty
NiladriChakraborty
11 Posts
ACCEPTED ANSWER

Pinned topic Changing service result xml structure without LJO

‏2013-06-09T00:50:31Z |

Hi,

My service returns the result in following structure:

<Rows>

        <Row>

                  <EMPID></EMPID>   <NAME></NAME>  <AGE></AGE>  </PHONE>  <CITY></CITY>

      </Row>

</Rows>

I need to change the structure in following format: 

<Rows>

        <Row>

                  <EMPID>

                               <NAME></NAME>  <AGE></AGE>  </PHONE>  <CITY></CITY>

                 </EMPID>

      </Row>

</Rows>

I have to put all other attributes inside <EMPID> to make it a collapsible section meaning <EMPID> will be parent attribute for others instead of their sibling attribute. Can someone please tell me what's the best builder to do this transformation without LJO.

-Thanks

 

  • mburati
    mburati
    2538 Posts
    ACCEPTED ANSWER

    Re: Changing service result xml structure without LJO

    ‏2013-06-10T14:49:00Z  in response to NiladriChakraborty

    While you could use the Transform builders (eg, Transform Map) to do this, it doesn't seem like you should need to, and that second XML structure doesn't look like a great structure for page automation because it has both a text node (the employee id value) and other children as children of EMPID.

    Was there a particular collapsible section mechanism you wanted to use that requires that second XML structure?

    I've attached a simple sample using your first XML structure with 6 rows,  where the model uses a Dojo Title Pane List via Data Layout Builder to collapse/expand each row, showing the emp id as the collapsible pane title,   and a Dojo According Container List via Data Layout that does the same.   You can disable one Data Layout and enable the other (right-click and enable or disable on the builder call in the builder call list in the outline view) to see the two options.    Neither required transforming your XML structure.

     I hope that info helps,

    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.

    Attachments

    • NiladriChakraborty
      NiladriChakraborty
      11 Posts
      ACCEPTED ANSWER

      Re: Changing service result xml structure without LJO

      ‏2013-06-10T15:48:07Z  in response to mburati

      Thank you for your quick response. It really helps. Could you please provide me a sample model which has transformation using Transformation Map. I was trying to map two schemas which is not generating expected result so wanted to figure out my mistakes.

      Thanks,

      Neel

      • mburati
        mburati
        2538 Posts
        ACCEPTED ANSWER

        Re: Changing service result xml structure without LJO

        ‏2013-06-10T16:51:45Z  in response to NiladriChakraborty

        There are a couple of transform samples posted in the following recent thread in this forum.   It looks like the second sample posted claims to have a sample of Transform Map and Transform Modify.

        https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014972476

        I hope that info helps,

         

        ..Mike Burati 
        The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
        • NiladriChakraborty
          NiladriChakraborty
          11 Posts
          ACCEPTED ANSWER

          Re: Changing service result xml structure without LJO

          ‏2013-06-11T06:24:05Z  in response to mburati

          Hi Mike,

          Thanks a lot for your help. But when I copy those models they appear as empty. This happens several times when I copy attached models from the forum. I am using WEF 8. Can you please let me know it's because of version mismatch or something is wrong?

          Thanks,

          Niladri

          • mburati
            mburati
            2538 Posts
            ACCEPTED ANSWER

            Re: Changing service result xml structure without LJO

            ‏2013-06-11T15:02:40Z  in response to NiladriChakraborty

            I just tried and saw the same thing (no builder calls) despite the model xml looking like it had a number of builder calls,   but I noticed an XML parse error in my Designer's debug console window (start Designer/Eclipse with -debug -console).   The XML parse error was complaining about text with no parent,  which usually happens with XML parsers when there's some extraneous text before the first open element tag or after the last end element tag in the document.

            Opening the downloaded model in a text editor I noticed  that at the very bottom of the file, there was extra characters after the end Model tag.   Deleting those extra chars, saving the model and reopening it in Designer via Model Editor shows the original builder calls.

            My guess is that in the migration from the old forum software to the new connections based forum software, that it somehow added extra junk to the end of these model attachments.

             

            I hope that info helps,
            ..Mike Burati 
            The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
            • NiladriChakraborty
              NiladriChakraborty
              11 Posts
              ACCEPTED ANSWER

              Re: Changing service result xml structure without LJO

              ‏2013-06-11T16:43:15Z  in response to mburati

              Thanks Mike. I am able to open the model. Thanks again for your help. I appreciate it.