Details

    • Type: Sub-task Sub-task
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Converters
    • Labels:
      None
    • JDK version and platform:
      1.5 for Windows

      Description

      I am coming back to the possibilty of having access to the parent object while unmarshalling...May be the solution is not the currentObject() method or the parentObject() method, but I use successfully XStream while writing my own converters, and i have not found any solution for the problem below:
      My XML is something like:
      <Map>
      <Catalog>
      <Member id="member1" ............></Member>
      <Member id="member2" ............></Member>
      <Member id="member3" ............></Member>
      <Member id="member4" ............></Member>
      </Catalog>

      .......
      <Item>
      <CatalogMember memberId="member2" ....... </CatalogMember>
      ....
      </Item>
      ...
      </Map>

      While the unmarshalling of CatalogMember, I need to access the <Catalog> object (may be from the top level ?) to find the correct <Member> that matches the id... so I would do a :
      Catalog catalog = ????? HERE something...
      Member member = catalog.getMember(reader.getAttribute("memberId");
      CatalogMember cm = new CatalogMember(member ....);

      Am I wrong or does it exist another solution that I could use (through the context ?)

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Hervé MENGA
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: