Help Required on Reading an External XML file in flex
Hi Experts
I want some help regarding flex.
I want to read an external xml file in flex and want to show
different datas in different components
So bacically i need what is the procedure to call an external
xml file and the procedure to catch the value of the xml tags and
the option (options means ex: "id" or "type inside" "row" tag ) in
side the xml file.
Here is My xml file named "skn_organ.xml"
<?xml version="1.0" encoding="UTF-8"?>
<slide>
<r>7</r>
<c>8</c>
<row id="A01" type="g">
<organ>Skn</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A02" type="g">
<organ>Brt</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A03" type="g">
<organ>Spl</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A04" type="g">
<organ>Lnode</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A05" type="g">
<organ>Ske</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A06" type="g">
<organ>Lun</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A07" type="g">
<organ>Sgl</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="A08" type="g">
<organ>Liv</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B01" type="g">
<organ>Gal</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B02" type="g">
<organ>Pan</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B03" type="g">
<organ>Ton</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B04" type="g">
<organ>Eso</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B05" type="g">
<organ>Sto</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B06" type="g">
<organ>Sto</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B07" type="g">
<organ>Sbl</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="B08" type="g">
<organ>Col</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C01" type="g">
<organ>Skn</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C02" type="g">
<organ>Brt</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C03" type="g">
<organ>Spl</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C04" type="g">
<organ>Lnode</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C05" type="g">
<organ>Ske</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C06" type="g">
<organ>Lun</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C07" type="g">
<organ>Sgl</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="C08" type="g">
<organ>Liv</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="D01" type="g">
<organ>Gal</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="D02" type="g">
<organ>Pan</organ>
<link>
http://www.designgarbage.com</link>
</row>
<row id="D03" type="g">
<organ>Ton</organ>
<link>
http://www.designgarbage.com</link>
</row>
</slide>
Hi sanjivsutar,
Put your xml file under folder "assets", the application demo
is as following
====================================================================
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
initialize="init()">
<mx:Script>
<![CDATA[
private var mainXML:XML;
private var loader:URLLoader;
private function init():void {
loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete);
loader.load(new URLRequest('assets/skn_organ.xml'));
private function onComplete(evt:Event):void {
mainXML = new XML(loader.data)
out.text += "xml loaded, using E4X syntax: \n\n";
out.text += "Row 1: "+mainXML.row[0]+"\n"
out.text += "Row 6: organ = "+mainXML.row[5].organ+"\n"
out.text += "Row(id='D02'): link =
"+mainXML.row.(@id=="D02").link+"\n"
]]>
</mx:Script>
<mx:TextArea id="out" width="400" height="300"/>
</mx:Application>
======================================================================
Jeffrey
Similar Messages
-
How to read an external XML file in a indesign Plugin?
Hi All,
Can you please guide in reading an external XML file in a indesign Plugin in MAC system. I am an windows user.We are using this file for reading some inputs.
Thanks,
DanielHello Daniel,
I am uncertain about the actual question. If you are developing a plug-in or otherwise interfacing with the guts of ID, I suggest asking the question in the SDK forum:
InDesign SDK Forum
Otherwise, what is it you are wanting to know concerning importing XML into InDesign?
Mike -
Import external xml file in PDF using Livecycle
I require sending some values in main xml file from the external xml file during sending mail on button click. Doing so, I want to read values from external file into a hidden field or send the external xml/text file as an attachment.
1. Is there any feature in live cycle to attach multiple xml/text files in mail using button click?
2. Is there any way to read an external xml file to pre-populate a textbox using javascript?
Kindly help me to find out the solution.
Thanks in advance
Vikram KumarHi,
1) You can do this with a script. But this script works only with the Acrobat Pro not with the Adobe Reader!!
2) Sure.
You open your form.
Go to File | Form Properties | Preview | then choose your xml-file
Then you have to got to the textobject | mark this | go to "Object" | "Binding"
Here you can bind the field: $record.PRINTJOB.PMSDATA.ObjectNameXML (You have to adapt this in the path in your XML to the field in the XML)
If you make a preview you will see the value of the XML in your textfield.
You can also script the databinding. You have to go to the initalize.event and write:
this.rawValue = xfa.record.PathToYourFieldInYourXML.ObjectNameXML.value;
Hope it will helps you,
Mandy -
How to read and write Xml file at client side using JavaScript !
Hello,
i am new to javascript.
I have requirement to read and update XML file at client side.
Will you please guide what could be the best way to read and update XMl file using javascript.
Thanks,
ZunedThis is a Java forum,not a Javascript forum. Maybe you should ask here [http://www.webdeveloper.com/forum/forumdisplay.php?forumid=3&s|http://www.webdeveloper.com/forum/forumdisplay.php?forumid=3&s].
-
How to edit/update data into an XML file using Flex and Actionscript
I can read an external xml file, please see the code below:
protected function button1_clickHandler(event:MouseEvent):void
var GrowthChartsDataGrid:XML;
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("../GrowthChartsDataGrid.xml");
loader.load(request);
loader.addEventListener(Event.COMPLETE, onComplete)
function onComplete (event:Event)
var loader:URLLoader = URLLoader(event.target);
GrowthChartsDataGrid = new XML(loader.data);
GrowthChartsDataGrid.GrowthChartGridView += <Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month>
texttesting.text = GrowthChartsDataGrid.toString();
I can read an XML file and can add an extra node and can display it in a text filed. But I want to update the XML file contents which will come from the txtMonth and txtWeight text boxes.
Please any suggestions???First of all thanks for your quick reply .
I actually want to add another node inthe xml file. Files is at a local location and i can read the file and add an extra node (but I cant store this extra node in the actual XML file). But I want to save XML with the extra node.
For exmaple,
my current xml is:
<?xml version="1.0" encoding="utf-8"?>
<GrowthChartGridView>
<Month> 1
<Weight>3.5</Weight></Month>
<Month> 2
<Weight>3.9</Weight></Month>
<Month> 3
<Weight>4.5</Weight></Month>
</GrowthChartGridView>
and at run time, I can create a new node using the data from two textboxes at button click event.
GrowthChartsDataGrid.GrowthChartGridView += <Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month>
Now what I want to do is, I want to add this node back in to my XML. Therefore, the result I am looking for is, my local XML should update like this.
<?xml version="1.0" encoding="utf-8"?>
<GrowthChartGridView>
<Month> 1
<Weight>3.5</Weight></Month>
<Month> 2
<Weight>3.9</Weight></Month>
<Month> 3
<Weight>4.5</Weight></Month>
<Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month> //I can read data from text boxes so its fine but I can not store this in to my original XML
</GrowthChartGridView>
Thanks -
Reading data From XML file and setting into ViewObject to Pouplate ADF UI
Hi,
I have following requirement.
I would like to read data from XML file and populate the data in ViewObject so that the data can be displayed in the ADF UI.
Also when user modifies the data in the ADF UI, it should be modified back into to ViewObject.
Here is an example - XML file contains Book Title and Author. I would like to read Book Title and Author from XML file and set it into ViewObject Attribute and then display Book title and Author in ADF UI page. Also when user modifies Book title and Author, I would like to store it back in View Object.
Please help me with this requirement and let me know if any solution exist in ADF, for populating the ADF UI screen fields with external XML file data.
ThanksRead chapter 42 http://download.oracle.com/docs/cd/E16162_01/web.1112/e16182/bcadvvo.htm of the fusion developer guide
Section 42.7, "Reading and Writing XML"
Section 42.8, "Using Programmatic View Objects for Alternative Data Sources"
Timo -
How can I set connection to external XML file with Dreamweaver to buiild AIR app?
Hello,
I try to do simple AIR app in dreamweaver. It's not problem
to use static data. But I'd like to use dynamic data from external
XML file. I try to use Spry and evrything works fine in web browser
but i have problem with loading external XML data into my app in
AIR. Can I simply transform my spry based html app into AIR?
What should I add to do this?
PawelDaniel Lichtenwald wrote:
What are the requirements and steps for arranging to receive this large file using File Transfer Protocol (FTP)?
Usually, we don't speak of "receive" when using FTP, since the file is transferred from server to client, so it's more of a case of "download".
At your end, it's simple. You use an FTP client; under SL, that includes Finder and Safari, so you don't even need to get any additional software.
At the other end, it's more complicated; the 'sender' must set up an FTP server on his machine.
Alternatively, you can set up your own Mac as an FTP server, and have the 'sender' connect to you with an FTP client and upload the file; but, if your Mac lives behind a router, then you have more work to do with the router settings.
That's why it's much easier to use the file sharing services mentioned above -- if they are available in both sender's and receiver's locations. (Keep in mind that some countries block access to all those mentioned -- except perhaps <www.transfer.ro>, of which I know absolutely nothing.) -
Testing SWF with external XML file, strange problem.
Hi!
My problem started after migration to 2.01. But I think it's
not version problem.
I have old project which uses external XML files ("
http://www.mydomain.com/myxml.xml").
When I teste project in "bin" folder it works perfect and SWF
import data from XML.
I created new Flex project and copied all scripts from old
one. And my new app can't read external XML!!! (tested in "bin"
folder):
*** Security Sandbox Violation ***
Connection to xmlURL halted - not permitted from
file:///C:/myproject/bin/myproject-debug.swf
BUT when I copy my new SWF to the old project "bin" folder
then it WORKS! Strange!
I found in Help "The Global Flash Player Trust directory" and
I checked files: "flexbuilder.cfg", "flexbuilder.fbr" there are all
my project paths (old and new).
Thanks for help!
newmanYou should your homework with Google and other search engines
better ;)
http://www.robrusher.com/1/2006/08/Flex-2-Error-with-XML.cfm -
Populating Tree with External XML File
I want to use external files for populating Flex 3
components. I have been successful using code very similar to that
below for a data grid & for a combo box, but it won't work for
a tree. Can you determine wh?
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:HTTPService id="dp_Tree1" url="Tree1.xml" />
<mx:Tree dataProvider="{dp_Tree1.lastResult.root.node}"
creationComplete="dp_Tree1.send()" width="333"/>
</mx:WindowedApplication>
It's not working & I can't determine why. Attached is my
xml file that I tested it with.Thanks a bunch folks, but my intent is to have as little code
as possible. I want to help people who are not coders create
designs using external xml files to populate controls. I was able
to create very simple code with just two lines to populate a
DataGrid from an external xml file:
<mx:HTTPService id="dp_DataGrid1" url="DataGrid1.xml"
/>
<mx:DataGrid
dataProvider="{dp_DataGrid1.lastResult.component.rows}"
creationComplete="dp_DataGrid1.send()" />
And just two lines for a ComboBox:
<mx:HTTPService id="dp_ComboBox1" url="ComboBox1.xml"
/>
<mx:ComboBox
dataProvider="{dp_ComboBox1.lastResult.component.rows}"
creationComplete="dp_ComboBox1.send()" />
Isn't it possible to populate a tree with two lines like as
it is with a DataGrid & ComboBox? -
Firefox flash plugin not loading external xml file?
I have a Flash based website that uses an external xml file
to load the interface and navigation. When I view the site in
Firefox it never seems to load the xml file therefore the interface
doesn't load.
Any ideas?Hi,
I have followed your instructions and could able to get it working for firefox. The sameway i tried with mozilla, but not working. This time, I didnt see any errors but it is not working as expected (no animations / images displayed)
So could you please help me.
My system config. is X86 Solaris 5.10.
bash-3.00# pwd
/usr/sfw/lib/mozilla/plugins
bash-3.00# elfdump -e libflashplayer.so
ELF Header
ei_magic: { 0x7f, E, L, F }
ei_class: ELFCLASS32 ei_data: ELFDATA2LSB
e_machine: EM_386 e_version: EV_CURRENT
e_type: ET_DYN
e_flags: 0
e_entry: 0x94 e_ehsize: 52 e_shstrndx: 37
e_shoff: 0x7fb4ac e_shentsize: 40 e_shnum: 39
e_phoff: 0x34 e_phentsize: 32 e_phnum: 3Thanks
Ram. -
Read/update large xml files
Hi,
My requirement is to store and update data in xml files (no other option) which can be of size > 100MB.
This is what I am doing at the moment..
1. In order to be able to modify, delete nodes easily I am using DOM (Dom4j)
2. As the file size is blowing up memory I have decided to distribute data in multiple files as one file per day. In a loop I load each file as Document, modify or delete nodes and write back to disk.
The problem is its still taking a lot of time to complete one operation and intuitively I am not comfortable with this design, I guess there is better options available..
Can anybody suggest a better alternatives for this using less memory and faster update times. I did a bit of search on google but none like JAXP or JAXB solve my problem.I had a similar problem.
I had to read through an XML file and then output it in a certain format of text file. The normal size of the XML files I was working with would be between 200KB and 3MB.
I wrote the code for doing this using DOM, and it worked okay, and reasonably fast.
However when I tested the file with huge files (~150MB) it completely ate up the systems memory, and eventually crashed, even with a hugely extended Java heap.
So to solve my problem I re-wrote the program using SAX. This concerned me at first, for I'm sure the same reasons you're thinking now. At first it took me a while to get my head around how to use it, but now that I understand how it works, I find SAX to be a superior way to work with XML in Java.
In addition, the performance improvements are huge. The program now works over twice as fast, and uses a comparatively minimal amount of memory.
So my suggestion is to do a bit of reading about SAX and port your application to use it. If you have any questions regarding this, I'd be happy to help, especially as I've recently done the same thing. -
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}) -
JSP compiler reading the web.xml file?
Hi,
I am trying to use the weblogic JSP compiler (weblogic.jspc) to
pre-compile some JSP that use custom tags. Does the compiler
read the web.xml file if there is one? In particular the taglib
elements in that file so that the compiler understands the
<%@ taglib ... %> directive.
In the JSP I try to compile I use this statement to declare a taglib:
<%@ taglib uri="xyz/xyz-taglib" prefix="xyz" %>
and in my web.xml I have:
<taglib>
<taglib-uri>xyz/xyz-taglib</taglib-uri>
<taglib-location>/WEB-INF/tlds/xyz.tld</taglib-location>
</taglib>
When I try to compile the JSP I get the following error:
Could not parse embedded JSP code: weblogic.utils.ParsingException: nested
IOException: java.io.IOException: cannot resolve 'xyz/xyz-taglib' into a
valid tag library.
Any ideas how I can resolve this?
In advance thank you for any help.
Florian
open it in a text editor and modify it.
% -
hi all
I have a problem reading back an xml file.
What I want to do is to store sensors and some vi parmaters.
To do it, I put the parmaters in a cluster, flaten it to xml and then write the xml file.
till here, no problem.
When I want to read back the xml file, it doesn't work with the way I do (I use unflaten and read xml file)
The datas i read back are not those I want to take back from my xml file.
Can somebody help me with this point?
The 7 datas filed are :
string
string
string
string
U16
I32
I32
Please help me with this, I cant do anything till this problem is solved.
Thanks in advance for your help.
ps : hereafter, the xml file i have written with labview. (I have put it in .txt to be sure the upload works.)
put it back in test.xml to wok whith it.
Attachments:
test.txt 1 KBHi,
there are two examples in Help >> Example Finder >> Fundamentals >> File Input and Output. One is Write Data to XML File and the other is Red Data from XML File. The first will write it and the second will read it back.
I expanded th example with the String data and the value provided in your post and it work even with the '/' in the data.Message Edited by waldemar.hersacher on 04-06-2005 11:23 PM
Waldemar
Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions -
External XML files in Flash iPhone apps
Hi everyone. I know that apple has loosened up on what is and isn't allowed on the app store these days, such as flash. I was thinking of writing an app that would call upon a web based xml file to call up pictures to display in the iPhone.
I know Apple doesn't allow apps that call upon external scripts but it's not an executable script, its a list of images and where they are stored. Does anybody have any input on whether Apple may have a problem with this?
Cheersdon't know.
I'm not sure of the differences between actionscript in flash and javascript in the browser but you could call for an XML file to be sent as json data from the script if accessing external XML files directly is not allowed.
Problem is that XML can contain anything you want it too... it could contain a script itself.
Maybe you are looking for
-
Generic extractor using function module
Hi all, We have created a generic extractor using a function module. We created a new custom function copied from 'RSAX_BIW_GET_DATA_SIMPLE'. has been set as the delta date for this data source in transaction RSO2.The function module is a custom ver
-
Line numbers appearing with imported Word Doc - InDesign CS2
For some reason I keep getting line numbers when I try to place a document from Word. I checked to see if Word had line numbering on..nope. I tried saving the file as a .txt and .rtf file and that doesn't help either. Any suggestions as to what I am
-
Hello, I am attempting to release a transport from our Dev system but am getting an error message 'Task Target QAI 111 CD but system cannot accept'. When looking into the message, the diagnosis is as follows: 'Your transport request could not be expo
-
Setting up Workflow Approvers in CUP
Hi Experts, I am in the midst of configuring the CUP workflow approval. I understand that in order for a user to approve a CUP request, I need to: 1. Create this user (approver) in UME 2. Assign this user with AE approver role However, my user base i
-
Nokia Silverlight - what is the current status?
About a year ago, amid big fanfare, it was announced that silverlight was goingto be available on the Symbian platform. Where can I download Silverlight for E71?