Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [SOLVED] QML parsing XML multiple tags with same name

[SOLVED] QML parsing XML multiple tags with same name

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 1.6k Views
  • 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.
  • M Offline
    M Offline
    mmlabeeb
    wrote on 4 Sept 2012, 07:51 last edited by
    #1

    One XML feed i am working with contains multiples tags with same name.
    Example code is below:

    @
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <palettes >
    <palette>
    <id>92095</id>
    <title>Some Title</title>
    <dateCreated>2007-07-03 10:42:02</dateCreated>
    <colors>
    <hex>69D2E7</hex>
    <hex>A7DBD8</hex>
    <hex>E0E4CC</hex>
    <hex>F38630</hex>
    <hex>FA6900</hex>
    </colors>
    </palette>
    </palettes>
    @

    This is a feed of color palettes.
    I want to parse all five hex color codes in XmlListModel and apply to five rectangles to show the color palette.
    If i query "hex/string()" it will not return all 5 values
    How can I do that?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mmlabeeb
      wrote on 4 Sept 2012, 09:07 last edited by
      #2

      Got it... It is xpath!!
      SO mapped @hex[1]/string()@ and others to respective colors of rectangles...

      1 Reply Last reply
      0

      1/2

      4 Sept 2012, 07:51

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved