Loading/unLoading XML data
Hello,
I have an accordion style btn that expands and contracts base on the user's cursor.
When the btn expands it loads an external XML file. The problem I'm having is that after the
btn contracts the loaded XML content is still in place. Is there a way to unload this XML content after it has loaded?
Cheers-
Graeme
I've attached my code,
What code would I need to use to Null that instance?
CODE:
stop();
function loadXML(loadedX) {
if (loadedX) {
xmlNode = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
load_pic();
} else {
content = "file not loaded!";
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
function load_pic(){
k = Math.floor(Math.random()*total);
picture_1.holder.loadMovie(image[k], 1);
//Store Button Position
var yPosition:Number = 210;
var xPosition:Number = 110;
//Declare New XML Object
var myXML:XML = new XML();
//Set Flash to ignore the XML file's white space
myXML.ignoreWhite = true;
//Declare new Array to store the links from the XML file
var links:Array = new Array();
//Declare new Array to store the names from the XML file
var names:Array = new Array();
//Set XML onLoad function
myXML.onLoad = function(){
//Set varible to store the XML childNodes
//This allows you to get the number of buttons in the XML file.
//You'll use this tell flash how many times to loop the for loop.
var linkname:Array = this.firstChild.childNodes;
//Set a for loop
for(i=0;i<linkname.length;i++){
//Push the button name into the names Array
names.push(linkname[i].attributes.NAME);
//Push the button link into the links Array
links.push(linkname[i].attributes.LINK);
//Attach the button Movie Clip from the libray give it an instance name and place it on the next highest level
_root.attachMovie("button","btn"+i,_root.getNextHighestDepth());
//Set the y position of the buttons
_root["btn"+i]._x = xPosition;
//Increace the varible yPosition 15 pixel each time the loop runs to place each button under each other
xPosition = xPosition+0
_root["btn"+i]._y = yPosition;
//Increace the varible yPosition 15 pixel each time the loop runs to place each button under each other
yPosition = yPosition+30;
//Place the button name from names Array into the blackTxt text box
_root["btn"+(i)].blackTxt.Txt.text = (names[i]);
//Place the button name from names Array into the whiteTxt text box
_root["btn"+(i)].whiteTxt.Txt.text = (names[i]);
//Assign the btnOver function to the button onRollOver state.
_root["btn"+(i)].onRollOver = btnOver;
//Assign the btnOut function to the button onRollOut state.
_root["btn"+(i)].onRollOut = btnOut;
//Assign the btnRelease function to the button onRelease state.
_root["btn"+(i)].onRelease = btnRelease;
//Load the XML file
myXML.load("links.xml");
//Button Over function
function btnOver(){
//This referse to the current button the mouse is over
//Go To And Stop frame 2 of the current button the mouse is over
this.gotoAndStop(2);
//Button Out function
function btnOut(){
//Go To And Stop frame 3 of the current button the mouse rolls out from
this.gotoAndStop(3);
//Button Release function
function btnRelease(){
//Set a varible named currentBtn equal to the instance name of the current button the mouse clicked on
var currentBtn:String = this._name;
//Set a varible named currentIndex equal to the varible currentBtn and the characters between 3rd letter and 5th of that string.
//This will return a number between 0 and the total number of buttons
var currentIndex:String = currentBtn.substring(3,5);
//Get the URL from the links Array
//Use the currentIndex varible as the index number
getURL(links[currentIndex]);
Similar Messages
-
Loading new xml data into a already xml populated image display
Hi everybody,
I have a question about loading new xml data into a already xml populated image gallery.
So I have my gallery set up so it calls some xml when it first loads. What I would now like to do is load different sets of images via a different xml sheet via the click of a button.
So for example the loaded gallery already has all thumbs loaded and user can click on them to view the full size image. So next instead of the user having to close this gallery to allow a new gallery to open with a different set of pictures I would just like to have a button. This button will unload the existing thumbs from the gallery and load in new ones from a different xml file.
If anybody can help me with this it would be great as I am still on a steep learning curve with AS3.
Here is my AS3
var xmlPath:String = "pictures.xml";
var xml:XML;
var loader = new URLLoader();
loader.load(new URLRequest(xmlPath));
loader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded(e:Event):void
if ((e.target as URLLoader) != null )
xml = new XML(loader.data);
createMenu();
var numberOfItems:uint = 0;
var menuItems:Array = new Array();
function createMenu():void
numberOfItems = xml.items.item.length();
var count:uint = 0;
for each (var item:XML in xml.items.item)
var imageLoader=new Loader();
var menuItem:MenuItem = new MenuItem();
menuItem.addChild(imageLoader);
imageLoader.load(new URLRequest(item.url));
menuItem.linkTo = item.linkTo;
menuItem.mouseChildren = false;
menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
menuItems.push(menuItem);
addChild(menuItem);
count++;
function ***():void
//menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
for (var i:uint = 0; i < menuItems.length; i++)
setChildIndex(menuItems[i], i);Thanks so much for the reply Andrei1
I think maybe my lack of knowledge when it comes to AS3 is not helping me at the moment because I thought I understood the code you supplied but there is something not going quite right.
So I messed around with the code and added the new_loaded_thumbs_btn to load in the "new_pictures.xml" but I am def doing something wrong.
import flash.ui.ContextMenuItem;
var xmlPath:String = "pictures.xml";
var xml:XML;
var numberOfItems:uint = 0;
var menuItems:Array = new Array();
var loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, xmlLoaded);
loadXML("pictures.xml");
new_loaded_thumbs_btn.addEventListener(MouseEvent.CLICK, loadXML);
function loadXML(path:String):void {
loader.load(new URLRequest("new_pictures.xml"));
function loadXML(path:String):void {
loader.load(new URLRequest(path));
function xmlLoaded(e:Event):void
xml = new XML(loader.data);
createMenu();
function createMenu():void
clearMenu();
numberOfItems = xml.items.item.length();
var count:uint = 0;
var imageLoader;
var menuItem:MenuItem;
for each (var item:XML in xml.items.item)
imageLoader = Loader();
menuItem = new MenuItem();
menuItem.addChild(imageLoader);
imageLoader.load(new URLRequest(item.url));
menuItem.linkTo = item.linkTo;
menuItem.mouseChildren = false;
menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
menuItems.push(menuItem);
addChild(menuItem);
count++;
sortChildren();
// removes previously placed objects
function clearMenu():void {
var menuItem:MenuItem;
while (menuItems.length > 0) {
menuItem = menuItems[0];
removeChildAt(getChildIndex(menuItem));
menuItem.shift();
function sortChildren():void
//menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
for (var i:uint = 0; i < menuItems.length; i++)
setChildIndex(menuItems[i], i);
When the image display 1st loads it displays the new_pictures.xml thumbs which I thought would load through my new button when clicked.
And there was me thinking I was getting the hang of AS3.
Could you please point me in the right direction in what I am doing wrong,
Thanks for your time and effort in advance -
Unable to Load the XML data file in to RTF template
Hi Team,
We are working on the XML publisher reports,where the xml data is containing the Japanese Characters.
I am facing an error while loading my xml data which has the japanese characters values in between the XML tags into the RTF Template.Though i have installed Japan fonts in my system,still unable to load the data.
Could any one please help me out in this regard.
Thanks in Advance.Hi;
Hi please clearfy below question for can make you fast help
1. What is your OS?
2. What is your EBS verison?
3. What is your DB version and Db character set?
Also check:
About Oracle XML Publisher Release 5.6.3 [ID 422508.1]
Regard
Helios -
How to load the XML data of SAP to a target database
i use an IDocs to read from SAP and converted into XML (ie .XSD ) and now i want to move that XML data to target data base.
i am trying to move XML data to template table, but i am getting this mapping error , even though i used NRDM and mapping while moving to template table.
ERROR MESSAGE :
Invalid mapping expression for column <Query_1.SNDPRN>. Additional information: <Cannot parse expression.
Table <Query.EDI_DC40> for column <SNDPRN> does not occur in the FROM clause. For a top-level query, all columns must belong to some table in the FROM clause.. (BODI-1112351)>. (BODI-1111081)Hi Srikanth,
Please find my understanding below.Correct me if my understanding is wrong.
1)You have moved the data from IDOC to XML file (i.e Creating an XSD and using it as target).
2)Now this XML file, will you your source and you are going to load it into the target table.
The error looks like BODS is unable to parse the Hierarchy structure to the flat structure.
How are you un-nesting your data (Are you using XML pipeline) .
Thanks
Arun. -
Loading this xml data into tables
Hello,
I am having a problem loading this XML file into tables. The xml file structure is
<FILE>
<ACCESSION>
some ids
<INSTANCE>
some data
<VARIATION
</VARIATION>
<VARIATION>
</VARIATION> variation gets repeated a number of times
<ASSEMBLY>
</ASSEMBLY>
<ASSEMBLY>
</ASSEMBLY> Assembly gets repeated a number of times.
</INSTANCE>
</ACCESSION>
</FILE>
I created a table which has the structure:
create table accession(
accession_id varchar2(20),
Instance instance_type);
create or replace type instance_type as object
(method varchar2(20),
class varchar2(20),
source varchar2(20),
num_char number(10),
variation variation_type,
assembly assembly_type)
create or replace type variation_type as object
(value varchar2(2),
count number(10),
frequency number(10),
pop_id varchar2(10)
Created a similiar type for assembly.
When I load it, I could only store the first variation data but not the subsequent ones. Similarly for assembly I could only store the first data but not the subsequent ones.
Could anyone let me know how I could store this data into tables? I have also included a sample XML file in this message.
Thank You for your help.
Rama.
Here is the sample xml file.
<?xml version="1.0" ?>
- <FILE>
- <ACCESSION>
<ACCESSION_ID>accid1</ACCESSION_ID>
- <INSTANCE>
<METHOD>method1</METHOD>
<CLASS>class1</CLASS>
<SOURCE>source1</SOURCE>
<NUM_CHAR>40</NUM_CHAR>
- <VARIATION>
<VALUE>G</VALUE>
<COUNT>5</COUNT>
<FREQUENCY>66</FREQUENCY>
<POP1>pop1</POP1>
<POP2>pop1</POP2>
</VARIATION>
<VARIATION>
<VALUE>C</VALUE>
<COUNT>2</COUNT>
<FREQUENCY>33</FREQUENCY>
<POP_ID1>pop2</POP_ID1>
</VARIATION>
- <ASSEMBLY>
<ASSEMBLY_ID>1</ASSEMBLY_ID>
<BEGIN>180</BEGIN>
<END>180</END>
<TYPE>2</TYPE>
<ORI>-</ORI>
<OFFSET>0</OFFSET>
</ASSEMBLY>
- <ASSEMBLY>
<ASSEMBLY_ID>2</ASSEMBLY_ID>
<BEGIN>235</BEGIN>
<END>235</END>
<TYPE>2</TYPE>
<ORI>-</ORI>
<OFFSET>0</OFFSET>
</ASSEMBLY>
</INSTANCE>
</ACCESSION>
</FILE>Hello,
I could figure out how to load this XML file by using cast(multiset(
So never mind.
Thank You.
Rama. -
Conditional loading of XML data set?
Well, I've tried many different approaches to the following
seemingly simple issue. What I want to do is this:
dsParent = new Spry.Data.XMLDataSet("foo.xml","some/path");
dsChild = new
Spry.Data.XMLDataSet("{dsParent::@menu}","some/other/path"};
The trick, is that the @menu field is only defined for some
of the rows of the parent. I want to be able to filter this out as
follows:
<div spry:region="dsParent dsChild">
<div spry:repeat="dsParent">
<h3>{dsParent::@header}</h3>
<div spry:if="'{dsParentHead}'!=''">
<div spry:repeat="dsChild">
................ Stuff from dsChild ...................
</div>
</div>
</div>
Even better would be if the <div spry:repeat="dsChild">
just got repeated zero times so that there wasn't a need for a
conditional above it.
However, there doesn't seem to be any way to make this work.
When any rows with undefined @menu entries exist, my dynamic
regions never appear, and the mozilla javascript debugger shows
faults inside the loadURL code (presumably because the URL resolves
to an empty string). I tried to construct dsChild with a null
filename, then load the URL manually on events from the parent so
that I could only do so if the @menu was defined, but this scheme
doesn't seem to work (I believe that it is because there are no
events caused by dynamic region looping constructs, but I admit
that my understanding of what is happing in this code base is
sketchy at best).
IS there some way to do this? I really just want the dsChild
to produce a zero length table or otherwise get out of the way when
@menu is null..
John KubiatowiczHi Noni,
Look at the OracleXMLSQL Utility (XSU). You can use it to do
your loading. Keep in mind though, that you will only be able
to
run the utility as a client side program (i.e. can use the java
api provided by the utility, or use it's command line front end).
Noni (guest) wrote:
: I am relatively new to XML and would appreciate your help.
: How would I load XML data into our Oracle Database (Oracle
: 8.0.5)? The XML data structure is basically the same as that of
: the Oracle table where it will loaded.
: Thanks
Oracle Technology Network
http://technet.oracle.com
null -
I have an application that first creates an XML file from the
database and then redirects to another page which loads the spry
regions from the newly created XML file. The problem I have is
that, the first time this works fine, but if I select another
record from the database, even though the new XML file has been
created correctly when you are redirected, the old data is
displayed. It doesn't load the new XML data.I don't really have the answer to this issue but, I will say
in my experience, XML based apps are notorious for caching old
info. It's really pathetic actually. I experienced this with a
simple static XML file used on a page with SPRY regions and the
issue would not stop. I eventually discovered an obscure solution
revolving around the use of generating a random numbers with each
call to force the browser to load the new data. Hope this points
you in a useful direction. -
Loading external XML data into XMLObject
hey all,
i've been working on a basic fl2 app that generates a list of
posts from an external XML file located on my server
(www.omedia.mobi/forum.xml) The swf file is also located there in
the same directory .(crime.swf).
The app runs fine in the emulator, both when i tried to load
the data locally on my mac, and when i load it from the server. But
when i put the swf file on my N70, it fails to load the data.
I'm banging my head against a wall trying to get this sorted.
has anyone had any similar experiences?
any help would be apprieciated...
many thanks
MattMatt–
Dumb question, are you 100% sure that your phone is making
any connection to the internet? Does your phone read a name/value
variable from an external file?
I just build a file to test this (It won't work
online—it will only work on a phone.):
http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.swf
The FLA is also up:
http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.fla
Also, you can check out:
http://www.adobe.com/devnet/devices/articles/flashlite11_rss.html
quote:
//Some of the code from the FLA:
canLoad = _capLoadData;
if (canLoad == 1) {
urlPath = "
http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.txt";
loadVariables(urlPath, _root);
} else {
connection = "client does not support loading dynamic data";
// where "connection" is the variable name of the text field
If the connection is present, then I think I know what is
wrong. Let me know. -
I need to load some XML data into a staging table.
I am using this navigation path...
Home>Utilities>Data Load/Unload>Load>Load XML Data
The staging table is setup with the columns in the XML file.
I am receiving this error when I attempt to load the XML file:
ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00222: error received from SAX callback function
I'm not sure that I have the correct columns in the table to match the XML file.
Is there any documentation describing what columns should be in the table I am loading the XML data into?
Many Thanks,
ReidThere are detail steps here: Sending XML file data into BW
Otherwise please specify where you faced problems. -
Load a XML file 47mbyte (with records data) in the RTF
I load a XML data in the RTF file, but when I tried generate the EXCEL file, it get a error.
Can somedy help me?
Thanks.Can you paste the error message here?
-
Loading XML Data into Relational Table
Hello,
I receive an XML file generated from another tool (on Windows), I am trying to create a Linux shell script that will gather the needed XML file from my Linux database server, then have Oracle use this file to load the XML data into a relational table. This activity & data will be needed on an ongoing basis.
I have tried this two ways. First, I loaded the XML document into the database and tried to extract the data directly from the document, but that is not working. Now I want to try to read the data directly from the file on the server via select, however I am not getting any data returned. In the Select statement below, I am simply trying to query the data to see what is returned for my testing.
Create Table ci_results_table (transactionID Varchar2(100), //transactionID should be PrimaryKey but was getting NULL value errors during insert test, so removed PK
message Varchar2(200),
ci Varchar2(50),
processeddate xmltype,
status Varchar2(50),
sourcefile VarChar2(100));
select x.*
from XMLTable(
'TSPLoadResults/Results'
PASSING xmltype(bfilename('CMDB_DEVADHOCRESULTS_DIR','LoadResults-HP_146.results.xml'), nls_charset_id('AL32UTF8'))
COLUMNS
transactionID Varchar2(100) PATH 'TransactionID',
Result XMLType PATH 'Result',
Message Varchar2(200) PATH 'Message',
PrimaryKey Varchar2(50) PATH 'PrimaryKey',
ProcessedDate date PATH 'ProcessedDate',
Status Varchar2(50) PATH 'Status',
SourceFile VarChar2(100) PATH 'SourceFileName'
) x
Eventually I will need to build on this to limit the data returned to those records where SourceFileName is like 'HPDS%' and insert what is returned in to the ci_results_table. Attached is a sample Results XML file I am trying to load, It is named "ResultsTransformedtoUnix" because I used dos2Unix to convert it to Unix which may be right or wrong. (The output file I send out has to be transformed to DOS format before the other application can read it). Original file (before Unix conversion) named in script is also attached.
Please help. Thank you!Hi,
I see some wrong things in your query.
1) The obvious one, explaining why you're not getting any data : there's a typo in the XQuery expression, it's "Result" not "Results"
2) ProcessedDate cannot be extracted as a date (at least not directly) since it actually represents a timestamp, use TIMESTAMP WITH TIME ZONE datatype and cast back to DATE in the SELECT clause
3) transactionID is an attribute, it must be accessed with '@' (or 'attribute::' axis)
4) If the file encoding is truly ISO-8859-1 as the prolog suggests, then do not use AL32UTF8 but the corresponding charset name : WE8ISO8859P1
Here's the working query :
select x.transactionID
, x.Message
, x.Primarykey
, cast(x.ProcessedDate as date) ProcessDate
, x.Status
, x.SourceFile
from XMLTable(
'/TSPLoadResults/Result'
PASSING xmltype(bfilename('XML_DIR','LoadResults-HP_146.results.xml'), nls_charset_id('WE8ISO8859P1'))
COLUMNS
transactionID Varchar2(100) PATH '@transactionID',
Message Varchar2(200) PATH 'Message',
PrimaryKey Varchar2(50) PATH 'PrimaryKey',
ProcessedDate timestamp with time zone PATH 'ProcessedDate',
Status Varchar2(50) PATH 'Status',
SourceFile VarChar2(100) PATH 'SourceFileName'
) x
Using this query directly over the file will only perform decently (for large files) on 11.2.0.4 and onwards.
On prior versions, first load the file in a (temporary) XMLType column with Binary XML storage and SELECT from there.
because I used dos2Unix to convert it to Unix which may be right or wrong.
This conversion shouldn't be necessary. -
Error Loading XML Data into Template Builder
Hi,
I am using XMLP 5.6.2 with E-business Suite. I copied a seeded Oracle Apps report and changed the output from Text to XML. I executed the report and it generated XML Output. I saved the output file as an XML file using IE.
When I try to load the XML Data file in MS Word, I am getting:
'Error No :-1072896682: Invalid at the top level of the document.
Line No : 1
Position : 1
File Pos: 0
Source: Authentication failed
I never had this problem before using the older version of XMLP (I think it was 5.0).
Does anyone have an idea how to fix this?
Thanks,
SteveTry using "view source" within IE to get the XML in a text file (Notepad) and save it from there. Then it should load fine. When you save it directly from the browser window there is extra formatting that prevents it from being loaded in template builder.
-
Hi,
I need to load the xml data into the relational tables. I was trying to use a DOM parser, but the thing is that i had to hard code the element node values to match the columns in the tables, and in later stage if there is change to the xml i have to change my program and recompile, i want a more flexible solution, where in i can parse the data and load into database without much changes. I do not know how to accomplish this. I have searched on this topic, but could not find a clear solution anywhere. Can anybody suggest a solution to this.
Thanks & regards.For which database?
With the Oracle database an XML document may be stored in a database with the XML SQL (XSU) utility.
1. Create a table in the database with columns corresponding to the elements in the XML document.
2. With the XSU store the XML document. The attributes in the XML document do not get stored.
3. To store the attributes also, apply an XSLT to the XML document and convert the attributes to elements. -
Load xml data into oracle table
Hi,
How to load the xml data in to oracle table plz guide in this context
thanksUse the DBMS_XMLSAVE.INSERTXML procedure.
It works fine. -
Hi All,
I tried loading the XML data to BW using the how to document. everything is fine but in the final stage when i send the recordset uisng the HTML file given in the document its gives an error "Object Expected".
I tried a lot but not able to solve this. I searched the forum but could not find the answer to this.
Can anyone pls give me the solution for this.
Thanks
KapilHi Michael,
Thanks for your reply.
The note 717162 gives the details about integrating XI and BW and then sending an XML file (How to integrate XI and BW).
But the how to document for sending XML data to BW has different HTML file which has the following two input parameters.
Path to file:
BW SOAP service:
Where as the XI document has many fields as follows:
Path to file:
hostname:
port:
own business system:
namespace:
interface:
quality of service (EO/BE):
Could you pls help me with this.
Thanks
Kapil
Maybe you are looking for
-
Help installing AMD Radeon 8490 graphic card on HP Pavilion P7-1110
Appreciate any help on this that anyone can give. I'm at a loss at the moment. Just got an AMD Radeon 8490 graphics card to put into the HP Pavilion p7-1110 desktop. I have not opened up the back of a computer for probably ten years (used to do it
-
I've added songs and vedios to iTunes in my computer then I synchronise it with my Ipad3 ..... For the songs it was OK but for the vedios I got a message that some format are not supported then the screen became black with no video or sound ....how
-
CS5 custom build with GTX 285 for long-form 4k projects
I've been researching nonstop for several days, and it's time to ask for your expert opinions. I would appreciate any help. I'm ordering a new system for Production Premium CS5, and mostly I will use Premiere Pro CS5 to edit long-form projects (huge
-
class Movie { String title; String genere; int rating; void playIt() { System.out.println("Playing the movie"); public class MovieTestDrive { public static void main(String[] args) { Movie one = new Mov
-
How to uninstall a program in Leopard...?
For a new mac user, how do you uninstall a downloaded and installed third-party software/program? Do you just move it from applications to trash? Thank you in advance.