JiBX
  1. JiBX
  2. JIBX-351

The content of an element after a nested sub-element not parsed

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: JiBX 1.2.1
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Having the following XML structure:

      <rootelement>
      <subelement> Some content for sub-element</subelement>
      Some content for root element
      </rootelement>

      While binding it to corresponding Java objects the content for
      <rootelement> (Some content for root element) is interpreted as null.

      If we are moving the <rootelement>'s content before <subelement>, e.g.

      <rootelement>
      Some content for root element
      <subelement> Some content for sub-element</subelement>
      </rootelement>

      the <rootelement>'s content is interpreted alright ("Some content for root element")

        Activity

        Hide
        Dennis Sosnoski added a comment -

        How is your binding defined? The order of a <value style="text" .../> binding relative to child elements is important. If you want to allow for text to come either before or after <subelement> you need to use two separate <value> definitions in the binding, along these lines:

        <value style="text" field="pretext"/>
        <value name="subelement" field="subelement"/>
        <value style="text" field="posttext"/>

        Show
        Dennis Sosnoski added a comment - How is your binding defined? The order of a <value style="text" .../> binding relative to child elements is important. If you want to allow for text to come either before or after <subelement> you need to use two separate <value> definitions in the binding, along these lines: <value style="text" field="pretext"/> <value name="subelement" field="subelement"/> <value style="text" field="posttext"/>

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Laurentiu Soica
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: