Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Complex DS

    Hi,
    my data.xml looks so
    Code:
    <chatStatistics>
      <chatStatistic>
        <chatID>Chat3</chatID>
        <question>Question A</question>
        <answers>
          <answer>
            <nr>1</nr>
            <rating>5</rating>
            <text>Answer 1</text>
            <expert>expert</expert>
          </answer>
          <answer>
            <nr>2</nr>
            <rating>5</rating>
            <text>Answer 2</text>
            <expert>expert</expert>
          </answer>
        </answers>
      </chatStatistic>
      <chatStatistic>
      ...
      </chatStatistic>
      ...
    <chatStatistics>
    I can access chatID and question so:
    Code:
    setRecordXPath("//chatStatistic");
      
    DataSourceTextField chatIDField = new DataSourceTextField("chatID", "Chat ID");
    chatIDField.setRequired(true);
            
    DataSourceTextField queationField = new DataSourceTextField("question", "Question");
    queationField.setRequired(true);
    But how can I map answers???

    Thanks in advance.
    Last edited by sipungora; 12 Mar 2012, 13:49.

    #2
    Hi,

    I've partially solved it with
    Code:
    nrField.setValueXPath("answers/answer/nr");
    ratingField.setValueXPath("answers/answer/rating");
    etc.
    Unfortunately it only takes the first answer (with nr = 1). But there are more than one answer.
    Last edited by sipungora; 12 Mar 2012, 15:56.

    Comment

    Working...
    X