×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    15

    XMLListModel query logical or operation?

    Hi people,

    i've got an XML list model setup which reads data from a URL or an XML file, the structure of the XML file is shown below (very small example):

    The following xpath works in selecting BOTH Station and Line nodes - other than their names the content they contain is IDENTICAL, so once I have the nodes the XML roles are the same:

    /SyndicatedFeed/Lines/Line | /SyndicatedFeed/Stations/Stations
    However as soon as I place this onto a query element of the XMLListModel, it just doesn't work and throws a meaningless error:

    Error XPDY0002 in file:///home/tux/workspace-qt/myapp-build-simulator-Simulator_Qt_for_GCC__Qt_SDK__Release/myapp, at line 1, column 38: The focus is undefined.
    Error XPDY0002 in file:///home/tux/workspace-qt/myapp-build-simulator-Simulator_Qt_for_GCC__Qt_SDK__Release/myapp, at line 1, column 38: The focus is undefined.
    XML Fragment:

    <SyndicatedFeed>
    <Lines>
    <Line>
    <Name>Bakerloo</Name>
    <Colour>FFF</Colour>
    <BgColour>AE6118</BgColour>
    <Url>http://www.tfl.gov.uk/tfl/livetravelnews/realtime/tube/default.html</Url>
    <Status>
    <Text><![CDATA[Part closure]]></Text>
    <Colour>FFF</Colour>
    <BgColour>113B92</BgColour>
    <Message>
    <Text><![CDATA[Sunday 29 January, no service between Stonebridge Park and Harrow & Wealdstone. Replacement buses operate. ]]></Text>
    <Colour>000</Colour>
    <BgColour>FFF</BgColour>
    </Message>
    </Status>
    </Line>
    </Lines>
    <Stations>
    <Station>
    <Name>Waterloo</Name>
    <Colour>000</Colour>
    <BgColour>FFF</BgColour>
    <Url>http://www.tfl.gov.uk/tfl/livetravelnews/realtime/tube/default.html</Url>
    <Status>
    <Text><![CDATA[Station maintenance]]></Text>
    <Colour>000</Colour>
    <BgColour>FFF</BgColour>
    <Message>
    <Text><![CDATA[Please note that the Shell Centre entrance on York Road does not open on Sundays, please use the Waterloo Road or National Rail station entrances instead.]]></Text>
    <Colour>000</Colour>
    <BgColour>FFF</BgColour>
    </Message>
    </Status>
    </Station>
    </Stations>
    </SyndicatedFeed>

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2008
    Posts
    43

    Re: XMLListModel query logical or operation?

    Please check the Qt documentation(http://developer.qt.nokia.com/doc/qt...mlquery.html):

    -------->

    The focus can be accessed using the context item expression, i.e., dot (".").

    By default, the focus is not set and is undefined. It will therefore result in a dynamic error, XPDY0002, if the focus is attempted to be accessed. The focus must be set before the query is set with setQuery().

    There is no behavior defined for setting an item which is null.

Similar Threads

  1. how to combine base and relative query in XmlListModel?
    By hassan kassem in forum [Archived] Qt Quick
    Replies: 8
    Last Post: 2012-05-26, 16:16
  2. Replies: 0
    Last Post: 2011-12-19, 00:20
  3. XmlListModel problem
    By bgenady in forum [Archived] Qt Quick
    Replies: 2
    Last Post: 2011-08-01, 06:51
  4. XmlListModel and setRawHeader
    By atonical in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-07-14, 07:04
  5. Problem with XMLListModel
    By manikantan in forum [Archived] Qt Quick
    Replies: 3
    Last Post: 2011-06-27, 16:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •