Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved XmlListModel query returns wrong result?

    QML and Qt Quick
    2
    3
    240
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Diracsbracket
      Diracsbracket last edited by Diracsbracket

      This post is deleted!
      JonB 1 Reply Last reply Reply Quote 0
      • JonB
        JonB @Diracsbracket last edited by JonB

        @Diracsbracket

        Each <it> container can contain a different number of <si> elements.

        I don't understand: your <it> is not a container for <si> elements, it's a container for a <c> element which contains <si> elements.

        EDIT
        Maybe this is "terminology". I meant direct container, that's what it means to me. But I note now that your query is:
        /rm/bt/it[4]/c/si
        so you do have the c level in there.

        OK, let's be clear: your <it>s can only contain just one <c>?

        Diracsbracket 1 Reply Last reply Reply Quote 0
        • Diracsbracket
          Diracsbracket @JonB last edited by Diracsbracket

          @JonB
          Hi Jon,
          Thanks for your kind reply. I deleted my post before yours was visible.

          @JonB said in XmlListModel query returns wrong result?:

          your <it>s can only contain just one <c>

          Yes, well at least at that level.

          The reason I deleted my post is that I eventually got things sorted out, although I still don't really get why it didn't work.

          I realize that at first, I had <c> elements declared also within <si> sub-elements but given the structure of my query, I didn't think this should be a problem. The <c> elements represented a "code" element, some of which could consist of a sequence of "subcodes", which I again wrap inside a <c> container.

                  <it>
                      <b>b_info</b>
          	    <c>
                          <si><d>d_info1</d><c>s_info1</c></si>
                          <si><d>d_info2</d><c>s_info2</c></si>
                          <si><d>d_info3</d><c>s_info3</c></si>
                      </c>
                      <i>i_info</i>
                  </it>
          

          In any case, I modified the structure of my <it> element to the following in case of a composite code:

                  <it>
                      <b>b_info</b>
          	    <s>
                          <si><d>d_info1</d><c>s_info1</c></si>
                          <si><d>d_info2</d><c>s_info2</c></si>
                          <si><d>d_info3</d><c>s_info3</c></si>
                      </s>
                      <i>i_info</i>
                  </it>
          

          and for a simple code to:

                  <it>
                      <b>b_info</b>
          	    <c> simple_code</c>
                      <i>i_info</i>
                  </it>
          

          Using the above approach in addition makes it simpler to check if it is a composite code or not (/s and /c queries will be null/not null)...

          Thanks again!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post