How can I set the xml file data button colors?

I read an xml file to create a group of buttons. I also use a Repeater to create the Group of buttons.

I am the created buttons, but am unable to correctly set the fill color. I get the error 'Implicit coercion of a value of type String to a type unrelated to Array' if I try to plug r.currentItem.value, even when I used an Actionscript function to convert a string to an array of 2 uints. Is there a solution of casting of simple type that I'm simply not?

Any help would be greatly appreciated!

The xml file has the following format:

< color >
< color >
< name > cantaloupes < / name >
< value > 0xFFCC66 < / value >
< / color >
< color >
< name > banana < / name >
< value > 0xFFFF66 < / value >
< / color >
< color >
< name > lemon < / name >
< value > 0xFFFF00 < / value >
< / color >
< color >
< name > honeydew < / name >
< value > 0xCCFF66 < / value >
< / color >
< / color >

The code I have so far is:

<? XML version = "1.0" encoding = "utf-8"? >
"" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' initialize = "colors.send ()" layout = "absolute" > "
< mx:HTTPService id = "color" url = "assets/colors_standard.xml" resultFormat = "e4x" / > "
< mx:XMLListCollection id = source="{colors.lastResult.color}"/ "xlc_colors" >
< mx:TabNavigator left = "0" top = "0" right = low "0" = "0" >
< mx:Canvas label = "Tab 1" width = "100%" height = "100%" >
< mx:Accordion width = "200" left = "0" top = "0" low = '0' >
< mx:Canvas label = "Colors" width = "100%" height = "100%" >
< mx:Label text = "Current color Selection" left = "10" right = "10" top = "10" height = "20" fontWeight = "bold" / >
< mx:Button label = "Update of colors" left = "10" right = "10" top = "227" height = "22" id = "button_colors_update" / >
< mx:Canvas height = "189" left is '10' right is "10" top = "30" borderStyle = "outset" backgroundColor = "#e9e9e9" >
< mx:Tile id = "tile_standard" direction = "horizontal" tileWidth = "25" tileWidth = "25" horizontalAlign = "center" verticalAlign = "middle" borderStyle = "outset" left = "10" right = "10" top = "10" height = "134" backgroundColor = "#ffffff" >
< mx:Repeater id = "r" dataProvider = "{xlc_colors}" >
< mx:Button toolTip = "{r.currentItem.name}" height = "15" width = "15" x = "10" y = "10" / > "
< / mx:Repeater >
< / mx:Tile >
< mx:Button label = "Other colors" id = "button_colors_online" height = "22" left = "10" right = "10" low = "10" / >
< / mx:Canvas >
< / mx:Canvas >
< / mx:Accordion >
< / mx:Canvas >
< / mx:TabNavigator >
< / mx:Application >

Here you go:


http://www.Adobe.com/2006/mxml '.
verticalAlign = "middle" horizontalAlign = "center".
layout = "horizontal" >


[Bindable]
private var array: Array = ['blue', 'red'];
private var _color:String = "red";

private void fillColors(c:String): Array {}
StyleManager.getColorName ('red'), StyleManager.getColorName ('blue')
return [c, c];
}
]]>




Tags: Flex

Similar Questions

  • How can I parse the XML file using the Oracle's Sql query.

    Hi all
    I have an XML file that must analyze and display the result according to the following example
    Can you please recommend me an approach to get the result.

    For example, here is my XML:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < xmlns:pi = "urn:com.workday / picof pi: Extract_Employees" >
    < IP: employee >
    < Additional_Information: pi > < pi: pi function: PriorValue = "" > Intern - masteri¿½s < / pi: function >
    < / pi: Additional_Information >
    < / pi: employee >
    < / pi: Extract_Employees >

    Databases:

    Oracle Database 10 g Enterprise Edition release 10.2.0.3.0 - production

    SQL > SELECT * FROM NLS_DATABASE_PARAMETERS;

    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS.,.
    WE8ISO8859P1 NLS_CHARACTERSET
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI. SSXFF AM
    NLS_TIMESTAMP_FORMAT-DD-MON-RR HH.MI. SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI. SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI. SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    BINARY NLS_COMP
    NLS_LENGTH_SEMANTICS BYTES
    NLS_NCHAR_CONV_EXCP FAKE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 10.2.0.3.0



    The Xml file above with UTF-8 character sets which is multi bytes.

    But in my character database is WE8ISO8859P1 for example ISO-8859-1 (single-byte character set)

    SQL > SELECT extractValue (Value (x) ', ' / pi:Employee/pi:Additional_Information/pi:Job_Title','xmlns:pi="urn:com.workday/picof ' ')
    TABLE (XMLSequence (extract (XMLType (bfilename('XMLDIR','XML_Issue_227176.xml'), nls_charset_id ('AL32UTF8')),'/ pi: Employee ',' xmlns:pi="urn:com.workday/picof"'))) x;)))


    which gives the following error:

    Error:
    ORA-31011: XML parsing failed
    ORA-19202: an error has occurred in the processing of XML
    LPX-00200: could not convert from UTF-8 encoding to ISO-8859-1
    Error on line 1
    ORA-06512: at "SYS." XMLTYPE", line 295
    ORA-06512: at line 1

    Also I tried with this
    SQL > SELECT convert (extractValue (Value (x), ' / pi:Employee/pi:Additional_Information/pi:Job_Title','xmlns:pi="urn:com.workday/picof"'),'WE8ISO8859P1 ', 'UTF8'))
    TABLE (XMLSequence (extract (XMLType (bfilename('XMLDIR','XML_Issue_227176.xml'), nls_charset_id ('AL32UTF8')),'/ pi: Employee ',' xmlns:pi="urn:com.workday/picof"'))) x;)))

    The same error is according to the above error message.

    Please help in this regard.

    Thank you and best regards,
    Sandrine

    You know the code of real character behind "" or you receive the file like that?

    For the record, "" is the wildcard of UTF-8 (0xEFBFBD), so that the original character of the means has already been replaced and that very probably the file was not coded properly in the first place.

    With respect to the resolution of the problem, try another method to read the file:

    SQL> select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET';
    
    VALUE
    ----------------------------------------
    WE8ISO8859P15
    
    SQL> SELECT x.*
      2  FROM XMLTable(
      3         XMLNamespaces(default 'urn:com.workday/picof')
      4       , '/Extract_Employees/Employee'
      5         passing xmltype(
      6                   dbms_xslprocessor.read2clob(
      7                     'COP_DIR'
      8                   , 'XML_Issue_227176.xml'
      9                   , nls_charset_id('AL32UTF8')
     10                   )
     11                 )
     12         columns job_title varchar2(30) path 'Additional_Information/Job_Title'
     13       ) x
     14  ;
    
    JOB_TITLE
    ------------------------------
    Intern -  Master¿s
     
    
  • How can I query the XML file that is stored as a CLOB data?

    Hi people,

    Please see below the example XML file, which is stored in 'os_import_docs', 'document' as a CLOB column.

    I would like to ask this XML file using some select SQL.


    How can I query form below XML?
    <?xml version="1.0" encoding="UTF-8"?>
    <etd>
      <header>
        <AR>000000000</AR>
        <AW>0</AW>
        <CT>S</CT>
        <CU>H</CU>
        <CZ>SS48</CZ>
        <BU>4</BU>
        <CH>0032</CH>
        <CK>2012-11-01</CK>
        <CL>21:18</CL>
        <CW>225</CW>
        <CX>0</CX>
        <CF>SS-CZL18</CF>
        <DV>2</DV>
      </header>
      <account_group id="234">
        <account id="234">
          <invoice id="000742024">
            <da>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>A</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>88754515</BS>
              <AD>Mike Tyson</AD>
              <AC>Mike Tyson</AC>
              <AZ>CZ6521232465</AZ>
              <AE/>
              <CG>A</CG>
              <AL>A</AL>
              <BZ>.</BZ>
              <AH>Some street</AH>
              <AI/>
              <AF>Some city</AF>
              <AK>Kraj</AK>
              <AG>CZ</AG>
              <AJ>885 21</AJ>
              <CR>21-11-2012</CR>
              <AY>602718709</AY>
              <AV>800184965</AV>
              <AP/>
              <AO/>
              <AQ/>
              <AN/>
            </da>
            <da>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>A</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>88754515</BS>
              <AD>Mike Tyson</AD>
              <AC>Mike Tyson</AC>
              <AZ>CZ6521232465</AZ>
              <AE/>
              <CG>A</CG>
              <AL>L</AL>
              <BZ>Mike Tyson</BZ>
              <AH>Some street</AH>
              <AI/>
              <AF>Some city</AF>
              <AK>Kraj</AK>
              <AG>CZ</AG>
              <AJ>885 21</AJ>
              <CR>21-11-2012</CR>
              <AY/>
              <AV>800184965</AV>
              <AP/>
              <AO/>
              <AQ/>
              <AN/>
            </da>
            <detaildc CH="0032" AB="234" BS="11888954" BB="32" BA="CZ" AT="" CI="7077329000002340342" AU="" DU="1Z48395" CB="CZK">
              <dc>
                <AW>0</AW>
                <CT>D</CT>
                <CU>C</CU>
                <BY>31-10-2012</BY>
                <CA>25-10-2012</CA>
                <CV>8151</CV>
                <BT>12111</BT>
                <CJ>1</CJ>
                <AM>0</AM>
                <DR>PC</DR>
                <DS/>
                <DO>25-10-2012</DO>
                <DQ>18:42</DQ>
                <CE>1</CE>
                <BH>8151</BH>
                <CY>8151 SHELL MALKOVICE P</CY>
                <DP>049336</DP>
                <DT/>
                <BQ/>
                <BR>500000</BR>
                <CN>30</CN>
                <CM>030</CM>
                <BO>160,00</BO>
                <BF>38,900</BF>
                <BC>6224,00</BC>
                <BI>32,417</BI>
                <CD>B</CD>
                <BG>0,600</BG>
                <BK>31,817</BK>
                <BJ>0,000</BJ>
                <DI>8</DI>
                <BP>20,00%</BP>
                <CC>CZK</CC>
                <BM>5090,67</BM>
                <BN>1018,13</BN>
                <BL>6108,80</BL>
                <BD>5090,67</BD>
                <BE>1018,13</BE>
                <DW>6108,80</DW>
                <CO>Nafta</CO>
              </dc>
            </detaildc>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>1</DG>
              <CN>30</CN>
              <CM>030</CM>
              <DF>160,00</DF>
              <DH>litr</DH>
              <DJ>20,00%</DJ>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA>P</DA>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>2</DG>
              <CN/>
              <CM/>
              <DF>160,00</DF>
              <DH>litr</DH>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>19</DG>
              <CN/>
              <CM/>
              <DF/>
              <DH/>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>8</DG>
              <CN/>
              <CM/>
              <DF/>
              <DH/>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
          </invoice>
        </account>
      </account_group>
      <footer>
        <AR>999999999</AR>
        <AW>0</AW>
        <CT>S</CT>
        <CU>T</CU>
        <CZ>SS48</CZ>
        <BU>4</BU>
        <CH>0032</CH>
        <CK>2012-11-01</CK>
        <CL>23:04</CL>
        <CW>225</CW>
        <BX>1</BX>
        <CS>7</CS>
        <BW>0000000000000610880</BW>
      </footer>
    </etd>
    example - does not:
        select  x.*
        from os_import_docs d
             ,XMLTABLE('/etd/header'
                        PASSING httpuritype(d.document).getXML()
                        COLUMNS 
                           response_status varchar2(50) PATH 'AR'
                        )  x
       where d.object_id = 2587058
         and rownum = 1;  
    
     
    ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 6196, maximum: 4000)
    Thank you very much
    Tomas

    No error on my side.

    I just put in the comments the two columns:

    SQL> SELECT h.AR
      2       , h.CK
      3       , h.CF
      4       , i.AR4
      5       , i.AD
      6       , ddc.*
      7       --, i.AR5
      8       --, i.DG
      9       , ddn.*
     10       , h.CZ
     11       , h.BU
     12       , h.CH
     13       , h.CK7
     14       , h.CL
     15  FROM os_import_docs d,
     16       XMLTable(
     17         '/etd'
     18         PASSING xmlparse(document d.document)
     19         COLUMNS
     20           AR        varchar2(10) PATH 'header/AR'
     21         , CK        varchar2(10) PATH 'header/CK'
     22         , CF        varchar2(10) PATH 'header/CF'
     23         , CZ        varchar2(10) PATH 'footer/CZ'
     24         , BU        varchar2(10) PATH 'footer/BU'
     25         , CH        varchar2(10) PATH 'footer/CH'
     26         , CK7       varchar2(10) PATH 'footer/CK'
     27         , CL        varchar2(10) PATH 'footer/CL'
     28         , invoices  xmltype      PATH 'account_group/account/invoice'
     29       ) h
     30     , XMLTable(
     31         '/invoice'
     32         PASSING h.invoices
     33         COLUMNS
     34           AR4       varchar2(10) PATH 'da/AR'
     35         , AD        varchar2(20) PATH 'da/AD'
     36         --, AR5       varchar2(10) PATH 'dt/AR'
     37         --, DG        varchar2(10) PATH 'dt/DG'
     38         , detaildc  xmltype      PATH 'detaildc'
     39         , detaildn  xmltype      PATH 'detaildn'
     40       ) i
     41     , XMLTable(
     42         '/detaildc'
     43         PASSING i.detaildc
     44         COLUMNS
     45           DU        varchar2(10) PATH '@DU'
     46         , CB        varchar2(10) PATH '@CB'
     47         , DO        varchar2(10) PATH 'dc/DO'
     48         , CY        varchar2(20) PATH 'dc/CY'
     49         , BM        varchar2(10) PATH 'dc/BM'
     50         , CO        varchar2(30) PATH 'dc/CO'
     51       ) (+) ddc
     52     , XMLTable(
     53         '/detaildn'
     54         PASSING i.detaildn
     55         COLUMNS
     56           CI        varchar2(20) PATH '@CI'
     57         , BY_       varchar2(10) PATH 'dn/BY'
     58         , BM6       varchar2(10) PATH 'dn/BM'
     59       ) (+) ddn
     60  ;
    
    AR         CK         CF         AR4        AD                   DU         CB         DO         CY                   BM         CO                             CI                   BY_        BM6        CZ         BU         CH         CK7        CL
    ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ---------- -------------------- ---------- ------------------------------ -------------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
    000000000  2012-10-31 SS-CZL19   EI08P4993  ING. ANTONIN GURICA, 1Z48395    EUR        16-10-2012 ASFINAG POST_MAUT    1940,60    Dalnicni znamka                                                           SS47       4          0032       2012-10-31 01:25
    000000000  2012-10-31 SS-CZL19   EI08P4993  ING. ANTONIN GURICA, 1Z48395    EUR        17-10-2012 ASFINAG POST_MAUT    1328,10    Dalnicni znamka                                                           SS47       4          0032       2012-10-31 01:25
    000000000  2012-10-31 SS-CZL19   EI08P4993  ING. ANTONIN GURICA, 1Z48395    EUR        23-10-2012 ASFINAG POST_MAUT    1831,80    Dalnicni znamka                                                           SS47       4          0032       2012-10-31 01:25
    000000000  2012-10-31 SS-CZL19   EI08P4993  ING. ANTONIN GURICA, 1Z48395    EUR        24-10-2012 ASFINAG POST_MAUT    867,30     Dalnicni znamka                                                           SS47       4          0032       2012-10-31 01:25
    000000000  2012-10-31 SS-CZL19   EI08P4993  ING. ANTONIN GURICA, 1Z48396    EUR        23-10-2012 ASFINAG POST_MAUT    2749,00    Dalnicni znamka                                                           SS47       4          0032       2012-10-31 01:25
    
    
    
    000000000  2012-10-31 SS-CZL19   EI3496334  ING. ANTONIN GURICA, 1Z48397    HUF        29-10-2012 ALLAMI AUTOPALYAKEZE 233,50     Dalnicni znamka                                                           SS47       4          0032       2012-10-31 01:25
    000000000  2012-10-31 SS-CZL19   EI4DG3954  ING. ANTONIN GURICA,            EUR        22-10-2012 1047061              24267,70   Dalnicni znamka                                                           SS47       4          0032       2012-10-31 01:25
    000000000  2012-10-31 SS-CZL19   EI4E34269  ING. ANTONIN GURICA,            EUR        23-10-2012 TBS VIACARD          5671,60    Dalnicni poplatek                                                         SS47       4          0032       2012-10-31 01:25
    000000000  2012-10-31 SS-CZL19   EI8QF1520  ING. ANTONIN GURICA, 1Z48395    EUR        29-10-2012 LAMAIN               200,10     Dalnicni znamka                                                           SS47       4          0032       2012-10-31 01:25
    
    78 rows selected
     
    
  • How can I set the time and date of return on the office toolbar?

    After a lightning storm and some internal power outtages I noticed my clock disappeared from the office toolbar.  How can I get that back?  It is not no matter what another user of the user profile because I am the only user of this desktop computer...

    Type Notification area in the search box to start.

    Select Notification area icons in the list

    Select icons system Turn On or Off, at the bottom left

    In the drop-down next to the clock menu, select enabled.

  • CS3: How can I set the text of a button widget in my control panel?

    Hello

    I have a panel with a PanelObserver. Now, I like to set the text of a ButtonWidget of this Panel.

    How can I do?

    Thank you

    Hans

    Oops, make that ITextControlData.

    Take a look at CDialogController.cpp for some ideas of code.

    Dirk

  • How can I set the maximum number of reboots for my PDF files?

    I want to sent my PDF to a friend, but I just let see only twice.


    How can I set the maximum number of reboots for my PDF files?

    My software is Acrobat X

    You can't - a PDF security options do not allow control over the number of times the file can be opened, even using DRM.

  • How can I set the DSO AU to 8 MB during install/config grid Infrastructure?

    Hello

    How can I set the DSO AU to 8 MB during install/config grid Infrastructure? Storage installer screens do not have the ability to set a caliber of more big to ASM when creating initial DATA DG, just go with the value defaults to THE (1 MB). Our SAN provider did studies and for ASM a framework to THE 8 MB instead of the default 1 MB will give better performance. Is there a template that I can change preinstall so the installer will create the DG with a frame of 8 MB DATA?


    Thank you
    Tom

    Hello

    You can not change it to the default diskgroup created during installation of GI.

    Only option you have is to make an installation by default, create a new diskgroup and move all the files needed.
    If you can read German see here for a tip on how to do it:

    http://www.Oracle.com/WebFolder/technetwork/de/community/dbadmin/tipps/asm_dg_change/index.html

    Concerning
    Sebastian

  • How can I set the time axis on my waveform table to show run time that is to say whenever I start the program I should have 0 as the starting point

    How can I set the time axis on my waveform table to show run time that is to say whenever I start the program I should have 0 as the starting point. I've been messing around with the without success. I'm under Labview 2012.

    Thank you!

    Townes wrote:

    I can't understand what you mean. I have no formal training with labview. It took me a long time to write the simple program that I joined. Any guidance would be greatly appreciated!

    Its pretty normal for a beginner to take the time to write code. Right-click the map of waveform > Create > property node > historical data, you will get a property node, keep this at the beginning of the code and create a constant. You can also go to the VI properties and > run and select "clear indicators when it is called.

    I recommend you to go through the basic materials of LabVIEW which will give you an understanding on the basics of bases/components of LabVIEW.

  • How can I set the time on the toolbar of the low wing? When I click on the taskbar do a right-click and then click Properties, it does not give me the option to display the time?

    How can I set the time display on the toolbar of the low wing?  When I click with the right button on the taskbar, and click show properties, it does not give me the options to display the time?  Where should I go in windows 7 to do this?  I clicked on the date and time also, and it does give me an option to add there either. Please help.

    Thank you

    How can I set the time display on the toolbar of the low wing?  When I click with the right button on the taskbar, and click show properties, it does not give me the options to display the time?  Where should I go in windows 7 to do this?  I clicked on the date and time also, and it does give me an option to add there either. Please help.

    Thank you

    Right-click the taskbar, and then select Properties. On taskbar you of the tab, click Customize. Scroll to the clock and change the "behaviours" on it.

  • Can not get the XML save data to work

    I'm trying to store data in an XML file.

    I want to create and store this XML file, I copied this example directly from the documentation (http://developer.blackberry.com/cascades/documentation/device_platform/data_access/working_with_xml... but it does not work):

    // Create QVariantMap objects to contain the data for each employee
            QVariantMap firstEmployee;
    
            // Populate each object with data
            firstEmployee["firstName"] = QVariant("Mike");
            firstEmployee["lastName"] = QVariant("Chepesky");
            firstEmployee["number"] = QVariant("51649875");
    
            // Add each employee to a QVariantList
            QVariantList myEmployeeList = QVariantList() << QVariant(firstEmployee);
    
            // Add the employee list to a top-level QVariantMap, then wrap it in a QVariant
            QVariantMap topLevelEmployeeMap;
            topLevelEmployeeMap[".root"] = QVariant("employees");
            topLevelEmployeeMap["employee"] = QVariant(myEmployeeList);
            QVariant myData = QVariant(topLevelEmployeeMap);
    
            // Retrieve the working directory, and create a temporary .xml file in that
            // location
            QDir home = QDir::home();
            QTemporaryFile file2(home.absoluteFilePath("myXMLFile.xml"));
            qDebug() << "Came here";
            qDebug() << home.absoluteFilePath("myXMLFile.xml");
            // Open the file that was created
            if (file2.open()) {
                // Create an XmlDataAccess object and save the data to the file
                qDebug() << "I came in this if statement";
                XmlDataAccess xda;
                xda.save(myData, &file2);
            }
            else
                qDebug() << "I didn't come in this if statement";
    

    After having tried everything, I can't see the .xml file to display in the file Explorer. The print statement that prints the location... /data/ and the second print statement shows he's going in the case.

    I can not even an XML base to save, so I wonder if I'm doing something wrong.

    Thank you

    Hey there,

    Well, the thing is that she is using an object QTemporaryFile (file2) and according to the description of the class QTemporaryFile:

    ".... QTemporaryFile is used to create unique temporary files safely. The file itself is created by calling ( Open). The temporary file name is guaranteed to be unique (that is, you are guaranteed to not overwrite an existing file), and the file will be deleted eventually to the destruction of the object QTemporaryFile... »

    If the object of File2 is destroyed in your application, that would be your problem...  You check in the file while the application is running?  Otherwise, you must use QFile instead so that the file will still be there at the end of your app... etc. etc.

    https://developer.BlackBerry.com/Cascades/reference/QFile.html

  • How can I set the scope of the attributes are incompatible error in Windows 8 pro?

    How can I set the scope of the attributes are incompatible error in Windows 8 pro?

    Whenever I try to run a setup.exe file, it gives me this error. What can I do to fix this?
    Help, please!

    WOAH ARE RESISTING NOT EVERYONE!

    THERE IS A MUCH EASIER WAY TO DO THIS!
    Well, I looked for a solution on google (Yes google) for 20 minutes and found four sites that had a bajillion ways to solve this problem.
    Dang, I was wrong.  So, when I dropped, I searched it on youtube, and here's what I got it is frighteningly SIMPLE!
    These are the? indications that I give to you people of the video (easier to look at):
    1 right-click the volume in the taskbar icon, and select sounds
    2. scroll down about 3/4 on the events program: the list and select the option that says Windows user account control
    3. change the sounds: option ( no), and then click OK
    YOU ARE FINISHED NOW, AND THE PROBLEM IS SOLVED... I have no idea how it works, but it doesn't... I AM IN AWE IN FRONT OF
  • When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Thank you for your help in advance

    When I drag a file audio and video of the source on the timeline monitor, only the video file is transferred. How can I move the two files on the timeline? Thank you for your help in advance

    You must set the source patch:

  • How can I obtain the XML

    Hello

    I have not followed the example of XML file and I want to get items from this XML file. How can I get the XML elements?

    Databases
    SQL*Plus: Release 10.2.0.3.0 - Production on Tue Jul 24 17:17:55 2012
     
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
     
     
    Connected to:
    Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
     
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    XML
    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:skos="http://www.w3.org/2004/02/skos/core#">
      <skos:Concept rdf:about="http://my.site.com/#Acoustics">
        <skos:ID>12033</skos:ID>
        <skos:NO>150</skos:NO>
        <skos:ANO>232</skos:ANO>
        <skos:prefLabel>Acoustics</skos:prefLabel>
        <skos:historyNote>http://www.theiet.org/resources/inspec/</skos:historyNote>
        <skos:altLabel rdf:resource="http://my.site.com/#Sound"/>
        <skos:broader rdf:resource="http://my.site.com/#Physics"/>
        <skos:narrower rdf:resource="http://my.site.com/#Aeroacoustics"/>
        <skos:narrower rdf:resource="http://my.site.com/#Vibrations (Acoustics)"/>
        <skos:narrower rdf:resource="http://my.site.com/#Acoustic materials"/>
        <skos:THES>PHYS</skos:THES>
        <skos:STA>Candidate</skos:STA>
      </skos:Concept>
      <skos:Concept rdf:about="http://my.site.com/#Sound">
        <skos:NO>450</skos:NO>
        <skos:ID>1483636</skos:ID>
        <skos:USE>Acoustics</skos:USE>
      </skos:Concept>
    </rdf:RDF>
    Thanks in advance.

    Published by: 876991 on July 26, 2012 12:02

    However, if I need to include "skos: narrower" elements then what I have to do? I have to write PL/SQL code to this and this information separately? or I can get the items in the recurring SQL query?

    I knew you would ask this, which is why I predicted in my previous answer:

    However, if you want to retrieve recurring nodes such as , you must decide how you want the output to look like (collections nested etc..).

    So, how do you store repetitive items?

    For example, you can use a collection type:

    create type narrower_t is object ( res varchar2(2000) );
    /
    
    create type narrower_coll is table of narrower_t;
    /
    
    select x.ID
         , x.NO
         , cast(
             multiset(
               select res
               from xmltable(
                      xmlnamespaces(
                        'http://www.w3.org/1999/02/22-rdf-syntax-ns#' as "rdf"
                      , 'http://www.w3.org/2004/02/skos/core#' as "skos"
                      )
                    , '/skos:narrower'
                      passing x.narrowers
                      columns res varchar2(2000) path '@rdf:resource'
                    )
             )
             as narrower_coll
           ) as narrowers
    from th_xml t
       , xmltable(
           xmlnamespaces(
             'http://www.w3.org/1999/02/22-rdf-syntax-ns#' as "rdf"
           , 'http://www.w3.org/2004/02/skos/core#' as "skos"
           )
         , '/rdf:RDF/skos:Concept'
           passing t.in_file_1
           columns
             ID         number       path 'skos:ID'
           , NO         number       path 'skos:NO'
           , narrowers  xmltype      path 'skos:narrower'
         ) x
    ;
    
  • How can I set the default download locations

    How can I set the default download locations?

    You can watch here:

    • Tools > Options > general: downloads
  • I have music in a cd rw. How can I delete the music file.

    I have music in a cd rw. How can I delete the music file.

    Open the disk, click with the button straight on delete?

Maybe you are looking for

  • Solution for Thunderbird 25.0 crashes after installing the provider 1.0.2

    After noticing that this supplier had stopped working, I checked and found that the old Google API had been abandoned. The author of provider advised to change provider 1.0.2 on an interim basis, but in the meantime 1.0.3. I did and Thunderbird crash

  • Updates (optional) must be blocked if the essential addons are not yet compatible

    Example: I depend on Roboform to maintain several hundred secure passwords unique and credentials of the user. Updates to firefox often break the addon. I should be able to say thank you to any updates until the addons have caught up. At the present

  • Impossible to uninstall Adobe Reader 10.1.3. Error - the patch package could not be opened.

    Original title: Add or remove programs, what is meant by a hotfix package? I am trying to remove the program Adobe Reader 10.1.3 & when I try to remove it, I get an error message that reads: the patch package could not be opened.  Verify that the pat

  • Windows Vista activation key issues

    I have a Toshiba laptop, has problems with the firewall and had to take it to get fixed and when I got back with him all my stuff on Microsoft Word is "locked." I can't access any of my stuff out there, it's wanting to enter me an activation code to

  • Automatically send events

    On VMS 2.2 with SecMon 1.2.3 the rule of event/admin section allows you to send an email. I have a requirement to send an email to various signatures when they are triggered on a specific sensor. The email must include the source and address of desti