[SOLVED] QML parsing XML multiple tags with same name



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



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


Log in to reply
 

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