Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3692

Enhancing the element-append and drop options of InTransformReader used by transform feature

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.1
    • 2.4.2, 2.5
    • Core
    • None

    Description

      The current implementation is limited to

      transform
      transform the name of an existing element from x1:e1 to x2:e2,
      from

       
      <x1:e1 xmlns:x1="ns1" ...>
        <x3:e3>...</x3:e3>
      </x1:e1>
      

      to

       
      <x2:e2 xmlns:x2="ns2">
        <x3:e3>...</x3:e3>
      </x2:e2>
      

      using element property
      key="

      {ns1}e1" value="{ns2}e2"

      append
      wrap an existing element x1:e1 with a new element x2:e2,
      from
      <x1:e1 ...>...</x1:e1>
      

      to
       
      <x2:e2 ...>
        <x1:e1 ...>...</x1:e1>
      </x2:e2>
      

      using append property
      key="{ns1}

      e1" value="

      {ns2}e2"


      drop
      unwrap an existing element x1:e1 from element x2:e2,
      from
      <x2:e2 ...>
        <x1:e1 ...>...</x1:e1>
      </x2:e2>
      

      to
      <x1:e1 ...>...</x1:e1>
      

      using drop property
      value="{ns2}

      e2"

      The enhanced implementation provides the following additional operations.

      deep-drop
      drop an existing element x2:e2 completely,
      from

      <x3:e3 ...>
        <x2:e2 ...>
          <x1:e1>...</x1:e1>
        </x2:e2>
        <x2:e4>...</x2:e4>
      </x3:e3>
      

      to

      <x3:e3 ...>
        <x2:e4>...</x2:e4>
      </x3:e3>
      

      using transform property
      key="

      {ns2}e2" value=""

      In contrast, the previously supported drop (or unwrap) operation can be seen as a shallow drop which results in
      <x3:e3 ...>
        <x1:e1>...</x1:e1>
        <x2:e4>...</x2:e4>
      </x3:e3>
      

      using drop property
      value="{ns2}

      e2"

      append-pre-include
      append a new element x2:e2 with content v2 before an existing element x1:e1,
      from

      <x3:e3 ...>
        <x1:e1>...</x1:e1>
      </x3:e3>
      

      to

      <x3:e3 ...>
        <x2:e2>v2</x2:e2>
        <x1:e1>...</x1:e1>
      </x3:e3>
      

      using append property
      key="

      {ns1}

      e1" value="

      {ns2}e2:v2"

      append-post-include
      append a new element x2:e2 with content v2 inside an existing element x3:e3,
      from
      <x3:e3 ...>
        <x1:e1>...</x1:e1>
      </x3:e3>
      

      to
      <x3:e3 ...>
        <x2:e2>v2</x2:e2>
        <x1:e1>...</x1:e1>
      </x3:e3>
      

      using append property
      key="{ns3}e3/" value="{ns2}

      e2:v2"

      append-post-wrap
      append a new element x2:e2 to wrap the content of an existing element x3:e3,
      from

      <x3:e3 ...>
        <x1:e1>...</x1:e1>
        <x2:e4>...</x2:e4>
      </x3:e3>
      

      to

      <x3:e3 ...>
        <x2:e2>
          <x1:e1>...</x1:e1>
          <x2:e4>...</x2:e4>
        </x2:e2>
      </x3:e3>
      

      using append property
      key="

      {ns3}e3/" value="{ns2}e2"

      In contrast, the previously supported append (or wrap) can be considered as append-pre-wrap which results in
      <x2:e2>
        <x3:e3 ...>
          <x1:e1>...</x1:e1>
          <x2:e4>...</x2:e4>
        </x3:e3>
      </x2:e2>
      

      using append property
      key="{ns3}

      e3" value="

      {ns2}

      e2"

      The discussion regarding this change was discussed on users@cxf.
      http://cxf.547215.n5.nabble.com/Problem-with-new-transform-feature-td4599185.html#a4600916

      This change also corrects the issues reported in CXF-3681.

      Attachments

        Activity

          People

            ay Akitoshi Yoshida
            ay Akitoshi Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: