QML and XML List Model



  • Hi All,
    This is my first post and I am currently stuck as I do not have enough knowldge about working with XML. I have been able to load a few XML feeds into XmlListModel however I am having problems with this one. (Third feed that I need)

    @

    • <Header>
      <Identifier>Tfl | Service update - tube</Identifier>
      <DisplayTitle>Tfl | Service update - tube</DisplayTitle>
      <Version>1</Version>
      <PublishDateTime>Fri, 06 May 2011 00:49:00 +01:00</PublishDateTime>
      <Author>webteam@tfl.gov.uk</Author>
      <Owner>Transport for London</Owner>
      <RefreshRate>1</RefreshRate>
      <Max_Latency>2</Max_Latency>
      <TimeToError>5</TimeToError>
      <Schedule>Every minute</Schedule>
      <OverrideMessage />
      <ErrorMessage />
      <FeedInfo>Developer information regarding the current state of the feed. Not to be displayed.</FeedInfo>

    However nothing is loaded into the model using:
    @
    XmlListModel {
    id: tubethisweekendModel
    namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2001/XMLSchema-instance';"
    source: "http://www.tfl.gov.uk/tfl/businessandpartners/syndication/feed.aspx?email=///&feedId=1"
    query: "/TubeToday/lines/line"
    XmlRole { name: "linenameweekend"; query: "Name/string()" }
    XmlRole { name: "linebgcolourweekend"; query: "BgColour/string()" }
    }
    @

    *I am sure that my namespaceDeclarations is wrong, I am not sure what to do with "NoNamespaceSchemaLocation". * I have tried a few combination but I really have no idea. I hope someone can help here.

    Thanks,
    MJ



  • Ok, I think I got it, I was using /TubeToday/lines/line

    instead of /Lines/Line, big L not the small l :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.