Reading from an xml file

Hi All,
   I want to read an xml file and add that many checkboxes with the names specified in xml.
Can anybody please share a working sample code please
Thanks,
Ravisha

If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
www.ChikaraDev.com
Flex / AIR Development, Training, and Support Services
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:XML id="xml" source="data1.xml"/> 
  <mx:XMLListCollection id="xlc" source="{xml..item}"/>
  <mx:Repeater id="rp" dataProvider="{xlc}">
    <mx:CheckBox label="{rp.currentItem}"/>
  </mx:Repeater>
</mx:Application>
<?xml version="1.0" encoding="utf-8"?><items>
  <item>check1</item>
  <item>check2</item>
  <item>check3</item>
</items>

Similar Messages

  • Crystal Report that reads from an XML file Datetime or Date

    I have a Crystal Report 2008 that reads from an XML file, the source File XML Date data looks like this: 2008-03-10
    But the Crystal Report interpreted by datatime, I need the Crystal Report to look like this: 2008/03/10 (date) not 2008-03-10T00:00:00-05:00 (datatime)
    Look at an example (source file xml, report, and parameter file to execute report) at url: http://www.5websoft.com/sample.zip
    Import the file in the design and will to verify that interpret incorrectly the fields of type date as datetime
    not mapped currently for fields..
    Help.....
    Thanks!

    You could always reformat the field to only display the date portion:
    Format Field > Date and Time tab; choose the date style you need here.
    Or create a formula to extract just the date and use this field in your report:
    date({table.field})

  • How to read from a xml file(in String format) using a java program

    hi friends
    i have a string , which is xml format. i want read the values and display it.can any one suggest how to read a xml file of string format using a javaprogram
    thanks

            final DocumentBuilder db =  DocumentBuilderFactory.newInstance().newDocumentBuilder();      
            final InputStream documentStream = new ByteArrayInputStream(documentXMLSourceString.getBytes("utf-8"));
            final Document document = db.parse(documentStream);

  • How can I read an XML string that's not from an XML file?

    I've got a script I'm trying to setup that communicates over a socket to retrieve different directions from a custom built Java program.  The Java program listens to requests from the Adobe scripting engine (in my case it's a Photoshop script) on a socket and immediately responds with the next set of directions.  These directions are currently in XML format.  The issue I'm having is that I can't parse the XML data since it's entered into a new XML object from a string rather than being read from a file.  Even without the socket code, you can see the issue by doing the following:
    var xml = new XML("<test><data>hey!</data></test>");
    alert(xml.test.data);
    alert(xml);
    The first alert "should" return "hey!" (without quotes, of course), but it doesn't, while the second alert returns what you would expect it to:
    <test>
        <data>hey!</data>
    </test>
    It works fine if read from an XML file, but from a string, like shown above, it just presents an empty alert box when attempting to access "xml.test.data".  Any ideas on how to fix this issue?  Can it be fixed?  Has it been fixed in newer versions (I'm currently using CS4)?
    Thanks in advance for any help!

    Duh... found my error... I was attempting to access the data by referencing the created "root" element.  Since <test> is the very first element tag, it's setup as the root element, which you don't need to reference.  Changing the alert to alert(xml.data); fixed it.
    Now I just feel dumb, lol...

  • Error in Reading data from a xml file in ESB

    Hi,
    i created a inbound file adapter service which reads data from a xml file and passes it to the routing service and from there updates to the database.....
    (everything created in jdeveloper)
    But i am getting error....it is not getting updated to the database...when i check the database(select * from table) its showing one row selected but i couldnt find the data....
    Transformation mapping also i did...
    i think may be some error in reading the data from the xml file but not so sure.....
    please reply to this mail as soon as possible its very urgent

    Michael R wrote:
    The target table will be created when you execute the interface, if you set the option on the flow tab as instructed in step #6 of the "Setting up ODI Constraint on CLIENT Datastore" Section.
    Option     Value
    CREATE_TARG_TABLE      trueHi Michel,
    This was not my required answer.I am sorry that I was unable to clarify my question.Actually
    +This project executed successfully with some warning.Target Table is automatically created in database and also populated with data.But when I right-click Target Datastore(in >Mapping Tab of the Interface), and then select Data to View Data that needs to be inserted in the target table.I get some error like this:-...+This above line is the result of my project my problem is
    when I right-click Target Datastore(in Mapping Tab of the Interface), and then select Data to View Data that already inserted in the target table.Is not shown by the view data operation.
    I meant to say I am facing this error
    At the10(1010 written) step of
    Creating a New ODI Interface to Perform XML File to RDBMS Table Transformation
    wehre it says
    Open the Interface tab. Select Mapping tab, right-click Target Datastore - CLIENT, and then select Data. View Data inserted in the target table. Close Data Editor. Close the tabs...
    In my case when I use my sqldeveloper I can see data successfully inserted in my target table and also in error table (data that can't satisfy the constraint) .But I was unable to check this by following the above mentioned 10 th step and got this error.
    Thanks

  • Reading rule sets from an XML file

    Hi all,
    How can I read rule sets from an XML file? I have been given some rules in XML
    format and using those I have to query some content. I am using WLP4.0
    Also how can I code rules in java?
    Thanks in advance.

    You can have the following classes:
    Players class deriving from Vector (or containing a vector), and then
    Player class with attribute 'name'.
    class Players
               Vector myVector = new Vector();
                void addPlayer(Player p)
                      myVector.add(p);
                Player getPlayer(int index)
                      myVector.get(index);
    class Player
             private String myName = null;
             Player(String name)
                    this.myName = name;
             String getName()
                    return myName;
    }Then while handling the SAX events you can do the following:
    class MySAXHandler implements ContentHandler (or whatever the itnerface is)
                 public void startElement(String name,....)
                          Players p = null;
                          if(name.equals("Players"))
                                 p = new Players();
                         else if (name.equals("Name"))
                                p.add(new Player(value));
    }HTH,
    Kalyan.

  • How to read configuration data from an xml file (not web.xml)?

    Hi,
    I want to separate the application specific configuration parameters in a separate xml file and read them as and when they are needed? I know that I can use the wb.xml but I want to separate them in a different xml file because I don't want the web.xml file to be played around later after deployment. If any change is needed then it should be done in the application-config.xml.
    How can I read the parameters from this xml file in my jsp code and also what should be the location of this file if I have
    ../webapps/Root/application
    directoty structure ?
    Any help is greatly appreciated.

    can you give an example of a property file and also
    it is loaded in the jsp ?Hmm... loading properties in a JSP is not a very good idea. You should do it in a separate class, rather than mixing the logic with the display logic.
    Properties properties = new Properties();
    properties.load(UtilClass.class.getResourceAsStream("config.properties"));
    // Add a try - catch block around the load
    // for IOException...

  • Application to Read and Write the Configuration Data from a xml file

    Hi,
    I have to develop a Webdynpro application that will do the following:
    Read the Configuration data from an xml file
    If stored in a file , and the file is not found, prompt the user to provide the file location.
    Pre-Populate the screen(table) with the configuration data
    Allow the user to edit the data
    Store the configuration data when the user hits the Save button
    The config xml file details are as follows:
    Regardless of the location of the configuration data, the following fields will be stored
    Application (string) will always contain u201CSFA_EDOCSu201D
    Key (string) eg LDAP_USER, DB_PREFIX, etc.
    Type (character)  u201CPu201D = Plain Text, u201CEu201D = Encrypted
    Value (string)
    Since I am new to WD, I would require help on this.
    Please help.Its Urgent.
    Regards,
    Vaishali.
    Edited by: vaishali dhayalan on Sep 19, 2008 8:29 AM

    Hi,
    I have to develop a Webdynpro application that will do the following:
    Read the Configuration data from an xml file
    If stored in a file , and the file is not found, prompt the user to provide the file location.
    Pre-Populate the screen(table) with the configuration data
    Allow the user to edit the data
    Store the configuration data when the user hits the Save button
    The config xml file details are as follows:
    Regardless of the location of the configuration data, the following fields will be stored
    Application (string) will always contain u201CSFA_EDOCSu201D
    Key (string) eg LDAP_USER, DB_PREFIX, etc.
    Type (character)  u201CPu201D = Plain Text, u201CEu201D = Encrypted
    Value (string)
    Since I am new to WD, I would require help on this.
    Please help.Its Urgent.
    Regards,
    Vaishali.
    Edited by: vaishali dhayalan on Sep 19, 2008 8:29 AM

  • Need to insert values into a table from a XML file

    Hi,
    I'm an Oracle 9i/10g DBA with quite a few years experience, but I'm new to XML and dealing with it in database terms. I've been given a project that entails pulling XML values out of a file (or 100's of them) and storing them in the database so that they are searchable by end-users. The project is classified as secret so I'm unable to upload the specific XML or any info relating to the structire of the XML or the table I will use to insert the values into - sorry!! So, I've created an XML file with a similar structure to help people understand my predicament.
    The end-users only need to search on a subset of the total amount of columns from the table I'll insert data into, although the XML file has a lot more, so I dont need to store the other values - but I will need to store the name of the XML file (or a pointer to it so I know what XML file a particular set of values belong to) in another column of the table along with its associated values.
    I've been using the XMLTABLE function with some degree of success, although I had better succes using the XMLSEQUENCE function. However, I found out this is deprecated in 10g and replaced with XMLTABLE, so I guess it's better if I use this in case we ever need to upgrade to 11g.
    The main problem I've been having is that some elements in the XML files have multiple values for the one record when all the other records are the same. In terms of storing this in the database, I guess it would mean inserting multiple rows in the table for each element where the value differs. Here is a dumbed down XML file similar to what I've got along with the other SQL I've used:
    +<?xml version="1.0" encoding="UTF-8"?>+
    +<House>+
    +<Warehouse>+
    +<WarehouseId>1</WarehouseId>+
    +<WarehouseName>+
    +<Town>Southlake</Town>+
    +<State>Texas</State>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>25000</Area>+
    +<Docks>2</Docks>+
    +<DockType>Rear load</DockType>+
    +<WaterAccess>true</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Street</Parking>+
    +<VClearance>10</VClearance>+
    +</Warehouse>+
    +<Warehouse>+
    +<WarehouseId>2</WarehouseId>+
    +<WarehouseName>+
    +<Town>Poole</Town>+
    +<State>Dorset</State>+
    +</WarehouseName>+
    +<WarehouseName>+
    +<Town>Solihull</Town>+
    +<County>West Midlands</State>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>40000</Area>+
    +<Docks>5</Docks>+
    +<DockType>Rear load</DockType>+
    +<WaterAccess>true</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Bay</Parking>+
    +<VClearance>10</VClearance>+
    +</Warehouse>+
    +<Warehouse>+
    +<WarehouseId>3</WarehouseId>+
    +<WarehouseName>+
    +<Town>Fleet</Town>+
    +<County>Hampshire</County>+
    +</WarehouseName>+
    +<Building>Owned</Building>+
    +<Area>10000</Area>+
    +<Docks>1</Docks>+
    +<DockType>Side load</DockType>+
    +<WaterAccess>false</WaterAccess>+
    +<RailAccess>N</RailAccess>+
    +<Parking>Bay</Parking>+
    +<VClearance>20</VClearance>+
    +</Warehouse>+
    +</House>+
    CREATE TABLE xmltest OF XMLTYPE;
    INSERT INTO xmltest
    VALUES(xmltype(bfilename('XML_DIR', 'test.xml'), nls_charset_id('AL32UTF8')));
    Consequently, I need to...
    1) Retrieve the results from the XML file for all 3 warehouses where multiple values for the same sub-element are shown as 2 rowsthe result set. (I am guessing there will be 4 rows returned as warehouse sub-2 has 2 different elements for <WarehouseName>.
    2) Build a case statement into the query so that regardless of the sub-element name (i.e State or County), it is returned into the 1 column, for instance County.
    So, if I run a query similar to the following...
    select y.WarehouseId, y.Town, y.County, y.Area
    from xmltest x, xmltable('/House/Warehouse' .......
    I would like to get results back like this...
    ID Town County Area
    1 Southlake Texas 25000
    2 Poole Dorset 40000
    2 Solihull West Midlands 40000
    3 Fleet hampshire 10000
    Sorry for the non-formatting but I hope this all makessense to someone out there with what I'm trying to do.
    I appreciate any help whatsoever because, as i said before, I'm totally new to XML and trying to read the vast amount of information there is out there on XML is all a bit daunting.
    Many thanks in advance,
    Shaun.

    Hi again,
    Thanks for keeping the post open for me. I've had a look at the post illustrating the XFileHandler package, and tried to alter it to make it fit with my XML files. To help explain things, my XML file looks like this:
    <?xml version="1.0"?>
    <!DOCTYPE  CMF_Doc SYSTEM "CMF_Doc.dtd">
    <House>
        <Warehouse>
        <WarehouseId>1</WarehouseId>
        <WarehouseName>
           <Town>Southlake</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>House
        <WarehouseId>2</WarehouseId>
        <WarehouseName>
           <Town>Poole</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Solihull</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>40000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>3</WarehouseId>
        <WarehouseName>
           <Town>Fleet</Town>
           <County>Hampshire</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>
    <?xml version="1.0" encoding="UTF-8"?>
    <House>
        <Warehouse>
        <WarehouseId>4</WarehouseId>
        <WarehouseName>
           <Town>Dallas</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>5</WarehouseId>
        <WarehouseName>
           <Town>Dorchester</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Solihull</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>40000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>6</WarehouseId>
        <WarehouseName>
           <Town>Farnborough</Town>
           <County>Hampshire</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>
    <?xml version="1.0" encoding="UTF-8"?>
    <House>
        <Warehouse>
        <WarehouseId>7</WarehouseId>
        <WarehouseName>
           <Town>Southlake</Town>
           <State>Texas</State>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>25000</Area>
        <Docks>2</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Street</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>8</WarehouseId>
        <WarehouseName>
           <Town>Bournemouth</Town>
           <State>Dorset</State>
        </WarehouseName>
        <WarehouseName>
           <Town>Shirley</Town>
           <County>West Midlands</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>30000</Area>
        <Docks>5</Docks>
        <DockType>Rear load</DockType>
        <WaterAccess>true</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>10</VClearance>
      </Warehouse>
      <Warehouse>
        <WarehouseId>9</WarehouseId>
        <WarehouseName>
           <Town>Clapham</Town>
           <County>London</County>
        </WarehouseName>
        <Building>Owned</Building>
        <Area>10000</Area>
        <Docks>1</Docks>
        <DockType>Side load</DockType>
        <WaterAccess>false</WaterAccess>
        <RailAccess>N</RailAccess>
        <Parking>Bay</Parking>
        <VClearance>20</VClearance>
      </Warehouse>
    </House>And the XFilehandler package looks like this (I'm just trying to do a simple select only on WarehouseId & WaterAccess for the time being to keep things simple):
    create or replace package XFileHandler as
      TYPE TRECORD IS RECORD (
        WID     NUMBER(2)
      , WACCESS VARCHAR2(5)
      type TRecordTable is table of TRecord;
      function getRows (p_directory in varchar2, p_filename in varchar2) return TRecordTable pipelined;
    end;
    create or replace package body XFileHandler is
      function getRows (p_directory in varchar2, p_filename in varchar2)
       return TRecordTable pipelined
      is
        nb_rec          number := 1;
        tmp_xml        clob;
        tmp_file         clob;
        rec               TRecord;
      begin
        DBMS_LOB.CREATETEMPORARY(TMP_FILE, TRUE);
        tmp_file := dbms_xslprocessor.read2clob(p_directory, p_filename);
        LOOP
          tmp_xml := regexp_substr(tmp_file, '<\?xml[^?]+\?>\s*<([^>]+)>.*?</\1>', 1, nb_rec, 'n');
          exit when length(tmp_xml) = 0;
          --dbms_output.put_line(tmp_rec);
          nb_rec := nb_rec + 1;
        select y.WID, y.WACCESS
        into rec.WID, rec.WACCESS
        from xmltable('/House' passing xmltype(tmp_xml)
                      columns WID NUMBER(2) PATH 'Warehouse/WarehouseId',
                                  WACCESS VARCHAR2(5) PATH 'WaterAccess') y;
          pipe row ( rec );
        end loop;
        dbms_lob.freetemporary(tmp_file);
        return;
      end;
    end;Now, when I run the query:
    select * from table(XFileHandler.getRows('XML_DIR', 'XFileHandler_test.xml'));I get the error: ORA-00600: internal error code, arguments: [17285], [0x5CFE8DC8], [4], [0x45ABE1C8], [], [], [], []
    I had a look in the dump file for anything obvious, but nothing really stands out. Is there anything obvious in my code that I'm missing or something else which you may think could be causing this error, e.g in the regular expression regexp_substr?
    Many thanks,
    Shaun.

  • Using HTTPService to import data from a XML file

    Hello there!
    I'm having some problem's with this import... If anyone can
    help, I would appreciate it!
    I'm using this type of information as data source:
    public var dataCollection:ArrayCollection =
    new ArrayCollection([
    { id: "P1", name: "Porto", type: "team", children: [
    { id: "R1", name: "Dr Silva", location: "Bloco 1", type:
    "member" },
    { id: "R2", name: "Dra Neto", location: "Gabinete", type:
    "member"
    { id: "P2", name: "Braga", type: "team", children: [
    { id: "R3", name: "Dr Santos", location: "Bloco 2", type:
    "member" },
    { id: "R4", name: "Dra Sonia", location: "Piso 1", type:
    "member"
    But I want to import it from a XML file like this:
    <?xml version="1.0" encoding="utf-8"?>
    <items>
    <item id="P1" name="Porto" type="team">
    <children id="R1" name="Dr Silva" location="Bloco 1"
    type="member" />
    <children id="R2" name="Dra Neto" location="Gabinete"
    type="member" />
    </item>
    <item id="P2" name="Braga" type="team">
    <children id="R3" name="Dr Santos" location="Bloco 2"
    type="member" />
    <children id="R4" name="Dra Sonia" location="Piso 1"
    type="member" />
    </item>
    </items>
    I already import the file, but can not translate the data
    into a array collection.
    private function initApp():void {
    var httpService:HTTPService = new HTTPService();
    httpService.url = "dataprovider.xml";
    httpService.resultFormat = "e4x";
    httpService.addEventListener(FaultEvent.FAULT,
    onFaultHttpService);
    httpService.addEventListener(ResultEvent.RESULT,
    onResultHttpService);
    httpService.send();
    private function onFaultHttpService(e:FaultEvent):void
    Alert.show("Error reading data file.");
    private function onResultHttpService(e:ResultEvent):void
    //Convert the xml data to a array collection
    Thank you

    Hello Peter, and thank you for your reply's.
    My problem is that I'm receiving the data from the external
    file and I don't know how to get the children in place... I mean, I
    also have some data being received form a file that I can convert
    into an array collection, but the thing is, that file doesn't have
    children structure...
    It's something like this:
    <?xml version="1.0" encoding="utf-8"?>
    <items>
    <item id="T1" resourceId="R1" name="Cardiologia"
    startTime="25-3-09 8:0:0" endTime="25-3-09 8:30:0" />
    <item id="T2" resourceId="R2" name="Raio-X"
    startTime="25-3-09 9:0:0" endTime="25-3-09 9:15:0" />
    <item id="T3" resourceId="R3" name="Analises"
    startTime="25-3-09 12:0:0" endTime="25-3-09 12:45:0" />
    <item id="T4" resourceId="R4" name="Consulta"
    startTime="26-3-09 8:0:0" endTime="26-3-09 9:0:0" />
    </items>
    And I solve it with this (don't know if is the best):
    private function onResultHttpServiceTask(e:ResultEvent):void
    var a:Array = xmlListToObjectArray(e.result.item);
    tasks = new ArrayCollection(a);
    protected function
    xmlListToObjectArray(xmlList:XMLList):Array
    var a:Array = new Array();
    for each(var xml:XML in xmlList)
    var attributes:XMLList = xml.attributes();
    var o:Object = new Object();
    for each (var attribute:XML in attributes)
    var nodeName:String = attribute.name().toString();
    var value:*;
    value = attribute.toString();
    o[nodeName] = value;
    a.push(new ObjectProxy(o));
    return a;
    But when the children "enter in action" I don't know how to
    bring them to the array...
    This code you send it's preaty much the thing I need, but the
    thing is that I don't know how to call the children with data as
    e:ResultEvent...
    If you can help a bit more, I would really appreciate...
    Thank You

  • Error loading data from an XML file using HTTPService

    Hello All,
    I have a runtime error that has got me beat at the moment   I am building an App in Flash Builder 4 to run on AIR.
    The error is as follows: TypeError: Error #1009: Cannot access a property or method of a null object reference.
    What i'm Trying to Do:
    I have 2 DropDownList controls, the first is populated with country names and the other with language options.  All the 1st DropDownList control does
    is set an image control to display the country flag and enable the 2nd DropDownList.
    The 2nd DropDownList sets the langCode variable equal to the chosen language code.  I then call the language function and pass it langCode.  Using this variable, I build up the string
    so that langFilePath will be equal to the XML file (which is "Lang_GBR.xml") location on my desktop and then call the HTTPService.
    As soon as the language function is called, the runtime error occurs and highlights the line with btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;
    where I try to assign the button label with a new value from the XML file.
    I suspect this may be a trivial error but I just can't see it at the moment. 
    Any help or guidance would be appreciated.  Thanks
    Code:
    <fx:Script>
            <![CDATA[
                   [Bindable]
                   public var langFilePath:String;
                   public var langDir:File = File.desktopDirectory;
                   public var langCode:String;
                   public function countrySelect_changeHandler(event:IndexChangeEvent):void
                        switch (countrySelect.selectedItem)
                             case ('United Kingdom'): 
                                  trace("Item Selected was: "+ countrySelect.selectedItem);
                                  img_countryFlag.source = AngolaFlag;
                             break;
                             case ('France'): 
                                   trace("Item Selected was: "+ countrySelect.selectedItem);
                                   img_countryFlag.source = AustraliaFlag;
                             break;
                             default: 
                             break;
                        langSelect.enabled = true;
                        trace("1st dropdownbox");
                   public function langSelect_changeHandler(event:IndexChangeEvent):void
                        switch (langSelect.selectedItem)
                             case ('English'): 
                                 trace("Language Selected was: "+ langSelect.selectedItem);
                                 langCode = "Lang_GBR"; 
                             break;
                             case ('French'): 
                                 trace("Language Selected was: "+ langSelect.selectedItem);
                                 langCode = "Lang_FRA"; 
                             break;
                        language(langCode);
                   public function language(aParam:String):void
                        trace("Code Was: " + aParam);
                        trace("Lang dir: " + langDir.nativePath);
                        langFilePath = langDir.nativePath + "/" + aParam + ".xml";
                        trace("File to load: " + langFilePath);
                        trace("loadLangFile.url: " + loadLangService.url);
                        loadLangService.send();
                        btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;
              ]]>
    </fx:Script>
    <fx:Declarations>
         <s:HTTPService id="loadLangService" url="{langFilePath}"/>
    </fx:Declarations>
    <s:DropDownList x="10" y="201" id="countrySelect" prompt="Please Select Your Country" width="274" enabled="true" change="countrySelect_changeHandler(event)">
    <s:DropDownList x="10" y="348" id="langSelect" prompt="Please Select Your Language" width="274" enabled="false" change="langSelect_changeHandler(event)">

    Don't sure about your XML structure, but for now i see the problem here between this 2 lines of code:
    loadLangService.send();
    btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;
    Think data that your httpService should receive just can't go so fast to populate the lastResult before you call it in the next line
    Try adding a result listener to your service before you send it:
    loadLangService.addEventListener(ResultEvent.RESULT, handler);
    loadLangService.send();
    function handler(event:ResultEvent):void {
         btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;

  • Read from an XML previously created by LabView

    Hi everyone,
    My problem is, as the title says, I need to read Data from an XML file, if the file does not exist, LabView creates it. So far it works. After the creation though, when I go through the subroutine again and want to read the data back from the XML file, it brings me the Error Code 1006 and tells me something about not being able to read it since "the XML-Tag isn't the same type as the type of the variable connected." (roughly translated from German)
    The Variable I want to read something back to is a Cluster consisting of 2 Clusters constisting of 1) two numeric elements and 2) a string and a 1-D array of 12 numeric element.
    The part that's confusing me is, that LabView saved the data itself w/o problems and in its own XML format. So it shouldn't really bring up any problems reading it back to the same variable, now should it?
    If anyone has an answer, I'm happy about anything, this has been driving me nuts the whole day
    Thanks in advance and Regards,
    Pedro
    Solved!
    Go to Solution.

    Hi,
    sorry for my vague description, lets try to fix this:
    For writing the XML-File, I use "Write To XML File.vi", the LabView standard XML writing VI.
    For reading from it again, I use "Read From XML File.vi", also the LabView standard.
    My LabView version is 8.5
    I'll attach some pictures and the created XML file which I hope will be of help.
    "Limits Template.png" is my Cluster to save the data in. As I said previously, the data was written from this very cluster, yet it cannot be read back to it. As you can see in there, the array is created correctly with 12 elements and their corresponding sizes.
    Thanks in advance,
    Regards,
    Pedro
    EDIT: checked again, the error code indeed is 1106
    Attachments:
    Limits Template.png ‏13 KB
    test123788_Limits.txt ‏2 KB

  • Loading an xml file from an xml file

    I'm trying to load an xml file from an xml file, but I'm
    having problems. My first xml file is really simple - it only
    contains one attribute with the name of another xml file in it
    (eventually I will have multiple xml files in here and run a loop
    on them...this is why I want to load an xml file from an xml file).
    Currently, with the code below, I can get the main xml file
    to load ("main.xml"), but I cannot get the secondary xml files to
    load FROM the main.xml.
    I want to then take childNode values from the secondary xml
    file and use them within my .swf in text boxes and whatnot.
    Any guidance? I think I'm going wrong on the line where I'm
    saying "i.newxml.load(i.attributes.location);"
    - How can I get this to work?

    johnypeter:
    I tried changing the code inside the loop to use just
    "newxml" instead of "i.newxml", and I declared with "var newxml =
    new XML();" - was this what you were thinking?
    kglad:
    The reason I tried to use the loadXML() function in the loop
    was so that for each node in my "main.xml" it would load the new
    xml file listed - this is a no-no? Do you have any ideas as to what
    I could do?
    For the for-loop, what should I change in it? I'm not great
    with loops so I tried to modify some code from another loop I found
    in another forum thread - not the right way to do it here?
    Also, what should I trace? The value of the _root.address, or
    i.attributes.location? I have created dynamic text boxes on my
    stage to see if the correct value from the xml file loads (ie. the
    name of the xml file within the xml file) and it does, but now I
    don't know how to put that information into ANOTHER loadXML()
    function and get the node information from it - does that make
    sense???
    Below are the examples of the xml files I am using. In the
    first one, main.xml, I will have a list of multiple xml files, each
    with the same nodes and elements as in the details.xml file
    (different values, of course).
    This is just to give you an example of what I'm trying to
    accomplish - pulling ALL the addresses and phone numbers from
    multiple xml files. I cannot manually collect this information, as
    it is dynamic, and will be updated in each individual details.xml.
    I was hoping to collect the information by simply adding to and
    updating ONE xml file - main.xml.
    Do you think this can be done? Am I going about it the wrong
    way? I'm quite limited in AS knowledge, which is why I'm piecing
    together code from other posts!

  • How to populate a form from an xml file with multiple records

    I want to be able to create a single form that will add pages as needed based upon the number of records being imported from an xml file.
    I have an IRS form that does this exactly, but I do not know how to re-create it.  I entered data into the form, then exported that data to xml.  Then I opened that xml file in excel and added more records (this is just an easy way to manage the xml data in a tabular form).  Then I import the changed xml file into the IRS form and it adds as many pages as I have records.  Perfect!  Unfortunately, I cannot edit the form to examine the technique.  It does not appear to be relying upon any additional local javascript files.  It does use an 'add page' button which may suggest the form is using the template .spawn() technique, but when I try that in my own form, it gives me unique field names for each page which are then not consistent with the xml data.  Hopefully someone can help me understand what I am missing.

    did you want
    <record>0
    <data>"11.97.23.174/32"
    <record>address <data>
    <record>address <data>
    <record>subnet <data>
    <record>ip <data>"10.97.23.174"</data></record>
    </data></record>
    </data></record>
    </data></record>
    </data></record>
    or
    <record>0
    <data>"11.97.23.174/32"
    <record>address <data>
    <record>address <data>
    <record>subnet <data>
    <record>ip <data>"10.97.23.174"</data></record>

  • Draw a picture from a XML file

    Hi,
    the problem I have is the following.
    We have a UI (JNET) where you can create a data model which later on will be analyzied for data conistency. All details of the data model are stored in an XML file. To document what we did we need to create a word report. This word report should also contain a pricure of the data model which should be included automatically. The creation of the report itself is not a problem but I have no idea how I can include the picture of the data model.
    Is there a way of drawing/ a picture (jpg, gif, png, etc.) from a XML file using ABAP?? 
    I attached an example of the data model. It is also the target which should be displayed from the XML file.
    Thanks for your support.
    Best regards,
    Niklas

    Hi,
    Thanks for the reply.I got the solution for my problem.Actually i wanted to delete only a particular element.
    The solution to this is after using
    Element element = (Element)document.getElementsByTagName("job").item(r-2);
    element.getParentNode().removeChild(element);
    writeXmlFile(document,"xmlfilename");.

Maybe you are looking for

  • How to set deletion indicator to SERVICE ENTRY SHEET

    Dear Experts, Please explain, is it mandatory to set Deletion indicator to Service entry sheet before Start of Archiving Service  entry sheet. Also explain Procedural steps to set deletion indicator to service entry sheet. Thanks in Advance

  • Plug in tools (cut on crosshair)

    Is there a plug in tool that does the same as Esko PackEdge cut on crosshair tool?

  • Problem in html:link tag in struts

    hi every body i have a problem i have to pass two dynamic variable to next page using html:link tag how can i send it for example <a href = "editEmp.jsp?id=<%= empSno %>&&delete=no"> Edit </a> should be coverted into <html:link >and i want to pass 2

  • Using a bundled copy of Lion on older computers

    If I buy a new MacBook Air, it comes bundled with a copy of Lion. If I buy an app on the Mac App Store, the license terms state that I can legally install that app on up to (i think) 5 computers. So, does the bundled version of Lion count as a sort o

  • ORA-06502 PLSQL Numeric or value error character string buffer too small

    Hi Gurus help!! I received error message "ORA-06502: PL/SQL:Numeric or value error: character strong buffer too small." I use example code of "AJAX Get Multiple Values Tabular I" from Denes Kubicek http://apex.oracle.com/pls/otn/f?p=31517:239. I did