Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

XmlListModel query returns wrong result?



  • This post is deleted!


  • @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>?



  • @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!


Log in to reply