Through the XML file in a table?
Hi all
I am having trouble interrperting how I should browse a XML file and pushing it toward a table to display data sets.
Here is my as:
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = {function (ok)}
If {(ok)
ALLDATA = this.firstChild.childNodes;
allEntries = this.firstChild.firstChild.childNodes;
for (i = 0; i < alldata.length; i ++) {}
trace (newline + "letter:" + alldata [i] .nodeName);
for (r = 0; r < allEntries.length; r ++) {}
trace(allEntries[r].nodeName+":"+allEntries[r].firstChild);
}
}
} else {}
trace ("loading error");
}
};
myXML.load ("temp_glossary.xml");
This is my XML:
<? XML version = "1.0" encoding = "iso-8859-1? > <!-this - >
< Glossary >
< A >
< aardvark > he is an Aardvark < / Aardvark > <! - firstChild.firstChild.firstChild - >
< Apple > it is an Apple < / Apple >
< EPA > it's a monkey < / EPA >
< /A >
< B >
< Ball > it is a ball < / balls >
< bat > it is a bat < / Bat >
< bike > it is a bike < / Bike >
< /B >
< C >
< drive > it is a car < / car >
< heading > it is a cap < / Cape >
< Cook > This is a Cook < / Cook >
/ < C >
< / Glossary >
Output is currently:
Letter: A
Aardvark: he is an Aardvark
Apple: this is an Apple
EPA: it is a monkey
Letter: B
Aardvark: he is an Aardvark
Apple: this is an Apple
EPA: it is a monkey
Letter: C
Aardvark: he is an Aardvark
Apple: this is an Apple
EPA: it is a monkey
The output, I see I only have access to the firstChild whenever I write the words, but I do not know how to go about it increments to the next block of words. I guess I can do with a 2D array and iteration, but don't know how to implement.
Any help would be greatly appreciated, thank you.
Chris
:
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = {function (ok)}
If {(ok)
ALLDATA = this.firstChild.childNodes;
allEntries = this.firstChild.firstChild.childNodes;
for (i = 0; i
trace (newline + "letter:" + alldata [i] .nodeName);
for (r = 0; r
trace (Alldata [i] Sublst.ChildNodes(1).ChildNodes(0) [r].firstChild.nodeValue);
}
}
} else {}
trace ("loading error");
}
};
Tags: Adobe Animate
Similar Questions
-
Need help to read the xml file and place it in a table.
Nice day!
Here is the configuration. I have a xml file from another source which will call a stored procedure in my database (which I am supposed to create). This is a first for me, I've never done development pl/sql or worked with xml. :(
That's what I hoped to accomplish, if there is a better way, that I am open to him.
In short, to have a stored procedure that takes the xml file (transmitted by third parties via the call, no url must be a file), creates a temporary table and populates the two columns needed. Then, the SP will make a select join with the temporary table and other data available in another schema. Once the completed table selection will be truncated and dropped. SP farm.
Details:
DB: Oracle 11.2.0.1 RAC.
Charset: AL32UTF8
Example of XML: (nearly 10,000 lines like this in production)
"< MerchantID report =" "#" name = 'Conversion detail report' ReportStartDate = '2011-09-27 12:00:00GMT' ReportEndDate = '2011-09-27 21:38:13GMT"Version ="1.1"> < Conversion = '1234567891234567 D' MerchantReferenceNumber Convertingdate =" 2011-09-27 13:39:02 "RequestID ="1234567891234567891234"> < OriginalDecision > REVIEW < / OriginalDecision > < NewDecision > ACCEPT < / NewDecision > < Reviewer > testusr < / examiner > < ReviewerComments > no reason to reject. < / ReviewerComments > < Notes > < Note Date = "2011-09-27 13:39:02" AddedBy = "testusr" comment = "Took possession" / > < / Notes > < queue > Digital Review < / queue > < profile > Digital orders QA < / profile > < / Conversion > "
...
< / report >
What I tried.
I found a tutorial: http://it.toolbox.com/blogs/oracle-guide/oracle-and-xml-in-action-a-real-world-example-5319 I tried and was able to make it work. But I could not duplicate the results with my xml file. So I looked away and have had no success. :( I'm not a developer, so I'm really bad...
I found a note of support: (how to load an XML file into a Database Table using DBMS_XMLSave unaided Bfile [227476.1 ID]) and couldn't make it work.
I found some online then Odie son xml and tried these but slipped and couldn't get my versions of these great answers to work for me.
Then... I'm here now and hoping that someone could walk me through this.
I tinkered this SP (it doesn't have to be that way, the suggestions are greatly appreciated)
create or replace procedure xml_to_table (call_1 call_2) as
Start
run immediately "CREATE GLOBAL TEMPORARY TABLE XMLType IMRPT
--(clé primaire contrainte-imrpt_pk (MerchantReferenceNumber))
XmlType store as xml binary basicfile
-(high compression)
virtual columns
(MerchantReferenceNumber as (xmlcast (xmlquery ('/ Conversion/MerchantReferenceNumber ' from object_value content back) as VARCHAR2 (32))))
, NewDecision as (xmlcast (xmlquery ('/ Conversion/NewDecision ' from object_value content back) as VARCHAR2 (10)))
)
-ON COMMIT PRESERVE ROWS
run immediately 'save xml as a file on the local system?'
insert into IMRPT (MerchantReferenceNumber, NewDecision)
run immediately "join select statement.
run immediately 'truncate table IMRPT.
run immediately "drop table IMRTP.
end;
/
On my last test, I tried to select just in the xml file using this:
DECLARE
indomdoc DBMS_XMLDOM. DOMDocument;
innode DBMS_XMLDOM. DOMNode;
myParser DBMS_XMLPARSER.parser;
buf VARCHAR2 (2000);
BEGIN
myParser: = DBMS_XMLPARSER.newParser;
DBMS_XMLPARSER.setBaseDir (myparser, 'XML_DIR');
DBMS_XMLPARSER. Parse (myParser, "test.xml");
indomdoc: = DBMS_XMLPARSER.getDocument (myParser);
-just to test content
innode: = DBMS_XMLDOM.makeNode (indomdoc);
DBMS_XMLDOM.writeToBuffer (innode, buf);
Dbms_output.put_line (BUF);
dbms_xmldom.freeDocument (indomdoc);
dbms_xmlparser.freeParser (myParser);
END;
/
It was another accident and burn.
Any help would be appreciated.
Thank youLike I said:
Here is an example using a REF CURSOR variable ( you will need to declare a plus for your actual procedure )
Your procedure has two parameters, you must declare two variables to hold the two REF CURSOR ;)
DECLARE v_filename VARCHAR2(50) := 'DMReport.xml'; v_rc1 SYS_REFCURSOR; v_rc2 SYS_REFCURSOR; v_order_name VARCHAR2(100); v_reason_text VARCHAR2(100); BEGIN xml2table(v_filename, v_rc1, v_rc2); commit; loop fetch v_rc1 into v_order_name; exit when v_rc1%notfound; dbms_output.put_line('ORDER_NAME='||v_order_name); end loop; close v_rc1; loop fetch v_rc2 into v_order_name, v_reason_text; exit when v_rc2%notfound; dbms_output.put_line('ORDER_NAME='||v_order_name||', REASON_TEXT='||v_reason_text); end loop; close v_rc2; END; /
If you test this in SQL * Plus, do not forget to SET SERVEROUTPUT ON to see the result.
-
Load the XML file into Oracle external Table
I load the data from the XML file into an intermediate table Oracle using external Tables.Let's say below, it is my XML file
< header >
< A_CNT > 10 < / A_CNT >
< E_CNT > 10 < / E_CNT >
< AF_CNT > 10 < / AF_CNT >
< / header >
< student >
<>students-details
< Student_info >
< Single_Info >
< ID > 18 / < ID >
New York < City > < / City >
< country > United States < / country >
< Name_lst >
< Student_name >
Samuel < name > < / name >
Paul < Last_name > < / Last_name >
< DOB > 19871208 < / DOB >
Aware of < RecordStatus > < / RecordStatus >
< / Student_name >
< Student_name >
Samuel < name > < / name >
Paul < Last_name > < / Last_name >
< DOB > 19871208 < / DOB >< TerminationDt > 20050812 < / TerminationDt >
History of < RecordStatus > < / RecordStatus >
< / Student_name >
< / Name_lst >
< Personal_Info >
<>men < / Type >
< 27 > < / Age >
< / Personal_Info >
< / Single_Info >
< / Student_info >< student - register >
class < A >
< info >
< detail >
< ID student > 18 < / student >
EE < major > < / Major >
< course-Grades >
< course > VLSI < / course >
< degree > 3.0 < / Grade >
< / course-Grades >
< course-Grades >
< course > nanotechnology < / course >
< degree > 4.0 < / Grade >
< / course-Grades >
< / details >
< detail >
< ID student > 18 < / student >
THIS < major > < / Major >
< / details >
< / info >
class < A >
< Student_Enrol >
<>students-details
< student >I load this XML data file into a single table using an external Table. Could someone help me please with coding.
Thank you
Reva
Could you please help me how to insert my XML content into that.
Same as before, try a plain old INSERT:
insert into xml_pecos
values)
XmlType (bfilename ('XML_DIR', "test.xml"), nls_charset_id ('AL32UTF8'))
);
But you'll probably hit the same limitation as with the binary XMLType table.
In this case, you can use FTP to load the file as a resource in the XML DB repository.
If the XML schema has been registered with the hierarchy enabled then the file will be automatically inserted into the table.
Could you post the exact statement that you used to save the scheme?
In the meantime, you can also read this article, I did a few years ago, it covers the XML DB features that may be useful here, including details on how to load the file via FTP:
https://odieweblog.WordPress.com/2011/11/23/Oracle-XML-DB-a-practical-example/
And documentation of the course: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb06stt.htm#ADXDB4672
-
load the xml file into a database to help table of travel point
Hello
Someone help me please with a possible approach. I have an interface for APEX users where users can download a file xml in apex table wwv_flow_files using the element to browse with a button "submit". Now, after loading the xml file in the wwv_flow_files table. I need to read and load the xml data into a table sample_tbl. I'm using the version of Oracle APEX 4.0 and Oracle 10 g R2 database. Here is an example of XML file to load. Please help me possible suggestions.
<? XML version = "1.0" encoding = "UTF-8"? >
< dataroot generated =... >
< MySample >
< KeyId > 1234 < / KeyId >
eddskc < KeyName > < / KeyName >
< scheduleDate > 2013-06-16T 00: 00:00 < / ScheduleDate >
< StartTime > 2013-06-16T 08: 00:00 < / StartTime >
< EndTime > 2013-06-16T 08:30:00 < / EndTime >
< / MySample >
< MySample >
< KeyId > 5678 < / KeyId >
jppdf < KeyName > < / KeyName >
< scheduleDate > 2013-05-19T 00: 00:00 < / ScheduleDate >
< StartTime > 2013-05-19T 08: 00:00 < / StartTime >
< EndTime > 2013-05-19T 08:30:00 < / EndTime >
< / MySample >
< / dataroot >
Thanks in advance.
Thank you
Orton
orton607 wrote:
My sample_tbl has a start_time field and its data type DATE.
Good. Be sure to always store dates as the DATE.
The application (in this case, APEX) needs to format the date date type in the appropriate human-readable format.
The problem with the incoming data is the 't'. You will need to convert a space using REPLACE() in the framework so that your SELECT statement
From there on, conversion to the DATE data type is simply
to_date( replace( start_time_str, 'T', ' '), 'YYYY-MM-DD HH24:MI:SS') as start_time
And, just in case where, the conversion of DATE for the desired format:
to_char( start_time, 'MM/DD/YYYY HH12:MI:SS AM')
Although, I'm 'hours' as being left-padded with zeros... Am I looking for how / if you can get rid of the zero prefix (0).
-
Generate the XML file with elements and attributes in table Oracle
Hello
I have the following table structure.
CREATE TABLE SPOOL
(
COIL_ID NUMBER (10),
COIL_NUMBER VARCHAR2 (40),
COIL_PO_OPERATING_UNIT VARCHAR2 (20).
COIL_PO_NUMBER VARCHAR2 (40),
MILL_NUMBER VARCHAR2 (2),
MILL_COIL_STATUS VARCHAR2 (15).
ITEM_NUMBER VARCHAR2 (40),
COIL_WEIGHT NUMBER (38),
WEIGHT_UOM VARCHAR2 (10),
DOCUMENT_NUMBER VARCHAR2 (40),
DATE OF DOCUMENT_DATE,
DOCUMENT_STATUS VARCHAR2 (15).
DOCUMENT_TYPE VARCHAR2 (20).
DOCUMENT_SOURCE VARCHAR2 (20).
TEST_ID NUMBER (38),
NUMBER VALUE,
TEST_UOM VARCHAR2 (20).
TEST_STATUS VARCHAR2 (70).
TESTER_LOGIN VARCHAR2 (20).
EQUIPMENT_CODE VARCHAR2 (50).
DOC_STS_MSG VARCHAR2 (600)
)
/
For each record COILID, there could be several folders baased on TEST_ID/VALUE/TEST_UOM etc.
And I would like to prepare the xml file in the following format by selecting data in the COIL?
<? XML version = "1.0"? >
-coil xsi: noNamespaceSchemaLocation = "www.tempel.com/COIL.xsd" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:xdb = "http://xmlns.oracle.com/xdb" >
< CoilId > 1419532 < / CoilId >
< CoilNo > D2221050010A0 < / CoilNo >
Changzhou < CoilPOOperatingUnit > < / CoilPOOperatingUnit >
< CoilPONo > 4619 < / CoilPONo >
< MillNo > 86 < / MillNo >
Test of < MillCoilStatus > < / MillCoilStatus >
C5 050FP800 < ItemNo > < / ItemNo >
< weight > 7076 < / weight >
KILOGRAM of < GLU > < / UDM >
< DocumentNo > 0 < / DocumentNo >
< DocumentDate > 2013 - 01 - 11 < / DocumentDate >
< DocumentStatus > not < / DocumentStatus >
< DocumentType > test < / DocumentType >
CHIGMA1 < DocumentSource > < / DocumentSource >
< DocStsMsg test = '0' EquipmentCode = "CHIGMA1" TesterLogin = "dpkrueger" Value = "0.4992" TestUnit = "mm" Status = 'NonProcessed' TestId = "135" / >
< test DocStsMsg = '0' EquipmentCode = "CHIGMA1" TesterLogin = "dpkrueger" Value = "0.0128" TestUnit = "mm" Status = 'NonProcessed' TestId = "124" / >
< DocStsMsg test = '0' EquipmentCode = "CHIGMA1" TesterLogin = "dpkrueger" Value = "12" TestUnit = "mm" Status = 'NonProcessed' TestId = "125" / >
< DocStsMsg test = '0' EquipmentCode = "CHIGMA1" TesterLogin = "dpkrueger" Value = "0.5095" TestUnit = "mm" Status = 'NonProcessed' TestId = "127" / >
< DocStsMsg test = '0' EquipmentCode = "CHIGMA1" TesterLogin = "dpkrueger" Value = "0.5042" TestUnit = "mm" Status = 'NonProcessed' TestId = "128" / >
< DocStsMsg test = '0' EquipmentCode = "CHIGMA1" TesterLogin = "dpkrueger" Value = "0.5058" TestUnit = "mm" Status = 'NonProcessed' TestId = "129" / >
< DocStsMsg test = '0' EquipmentCode = "CHIGMA1" TesterLogin = "dpkrueger" Value = "0.4967" TestUnit = "mm" Status = 'NonProcessed' TestId = "130" / >
< DocStsMsg test = '0' EquipmentCode = "CHIGMA1" TesterLogin = "dpkrueger" Value = "0.5049" TestUnit = "mm" Status = 'NonProcessed' TestId = "131" / >
< DocStsMsg test = '0' EquipmentCode = "CHIGMA1" TesterLogin = "dpkrueger" Value = "0.4972" TestUnit = "mm" Status = 'NonProcessed' TestId = "132" / >
< DocStsMsg test = '0' EquipmentCode = "CHIGMA1" TesterLogin = "dpkrueger" Value = "0.4960" TestUnit = "mm" Status = 'NonProcessed' TestId = "133" / >
< DocStsMsg test = '0' EquipmentCode = "CHIGMA1" TesterLogin = "dpkrueger" Value = "0.4996" TestUnit = "mm" Status = 'NonProcessed' TestId = "134" / >
< / reel >
Can you please guide me how to do it in a single query?
Thanks in advance.Function EXTRACT will force a print in your version:
SELECT XMLElement("Coil", XMLAttributes( 'http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi" , 'www.tempel.com/COIL.xsd' as "xsi:noNamespaceSchemaLocation" ) , XMLForest( COIL_ID as "CoilId" , COIL_NUMBER as "CoilNo" , COIL_PO_OPERATING_UNIT as "CoilPOOperatingUnit" , COIL_PO_NUMBER as "CoilPONo" , MILL_NUMBER as "MillNo" , MILL_COIL_STATUS as "MillCoilStatus" , ITEM_NUMBER as "ItemNo" , COIL_WEIGHT as "Weight" , WEIGHT_UOM as "UOM" , DOCUMENT_NUMBER as "DocumentNo" , DOCUMENT_DATE as "DocumentDate" , DOCUMENT_STATUS as "DocumentStatus" , DOCUMENT_TYPE as "DocumentType" , DOCUMENT_SOURCE as "DocumentSource" ) , XMLAgg( XMLElement("Tests", XMLAttributes( DOC_STS_MSG as "DocStsMsg" , EQUIPMENT_CODE as "EquipmentCode" , TESTER_LOGIN as "TesterLogin" , VALUE as "Value" , TEST_UOM as "TestUnit" , TEST_STATUS as "Status" , TEST_ID as "TestId" ) ) ) ).extract('/*') FROM coil GROUP BY COIL_ID , COIL_NUMBER , COIL_PO_OPERATING_UNIT , COIL_PO_NUMBER , MILL_NUMBER , MILL_COIL_STATUS , ITEM_NUMBER , COIL_WEIGHT , WEIGHT_UOM , DOCUMENT_NUMBER , DOCUMENT_DATE , DOCUMENT_STATUS , DOCUMENT_TYPE , DOCUMENT_SOURCE ;
-
How to import the XML file into an oracle table using a BPEL process
Hi friends
How can I import XML file in the db oracle table using a BPEL process
(1) I have generated an XML file in my local system with a field
(2) I created a temporary table in my oracledb with the same field in the XML file
(3) that I want to import these XML files which is the local host to my db oracle using a BPEL process
(4) for that what steps should I me fallow please suggest me if there is no document for this?
Thanks in advance
ATHi to
Here you go...
http://blogs.Oracle.com/ajaysharma/2011/03/using_file_adapter_database_adapter_and_mediator_component_in_soa_11g.html
I hope that helps!
Thank you
AJ -
create table from the XML file at several levels
Hello
I'm working on the provision of an app to display xml data, which are currently using data from the settings file where the data was stored in a table.
CONT =]
[{txt: 'Perfume'} //main menu][[{txt: 'Top Note', framework: 'topNote'}, {txt: 'Heart notes', frame: "heartNote"}, {txt: frame, 'Note of Base': 'gaps'}] / / submenu]
,[
{txt: 'Packaging', field: 'packaging'} / / main menu]
]
I created an xml file and am able to recover data and impossible to find the same.
Here's the xml file
< Products >
< produces txt = setting "Perfume" = "" > "".
< = frame 'Top Note' = "topNote" txt file name > < / name of the file >
< = txt file name ' heart notes"frame ="heartNote"> < / name of the file >
< file name txt = "Core score" frame = 'gaps' > < / name of the file >
< / product >
< produces txt = framework of 'Packaging' = 'packaging' > < / product >
< produces txt = framework "3D Animation" = "tvAd" video = "true" flvName = "video.flv" w = "547" h = "309" > < / product >
< product txt framework "advertising Lla' = 'the package' = >
< name of the txt-file = "Print Ad Creative Pack" frame = "printCp" > < / name of the file >
< / product >
< / product >AS A CODE
---------------------------------------
(GlobalVarContainer.myXML is the place where is stored the xml file)
var node:XMLNode = GlobalVarContainer.myXML.firstChild;
var navItm:int = int (node.childNodes.length);
for (i = 0; i < wheel; i ++) {}
var temp_array:Array = new Array();
var subnavCount:int = int (node.childNodes [i].childNodes.length); subnav
var obj:Object = new Object();
obj.txt = node.childNodes [i] .attributes ['txt ""]
obj. Frame = node.childNodes [i] .attributes ["frame" "]
trace (node.childNodes [i]. Attributes ['txt'])
for (var j: int = 0; j < subnavCount; j ++)
{
trace (node.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [j]. Attributes ['txt'])
obj.subtxt = node.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [j]. Attributes ['txt'];
obj. Subframe = node.childNodes [i] Sublst.ChildNodes(1).ChildNodes(0) [j]. Attributes ['frame'];
temp_array.push (obj);
}
GlobalVarContainer.my_array.push (temp_array);}
If I add - trace (GlobalVarContainer.my_array); -to code the outout is
[object Object], [object Object], [object Object]
[object Object], [object Object], [object Object],.
[object Object], [object Object], [object Object],.
[object Object], [object Object], [object Object], [object Object]but trace (.txt [i] GlobalVarContainer.my_array + "array"); or trace (GlobalVarContainer.my_array [i] [0] .txt + "array"); no results.
need advice to move forward from here.
Thank you
AYUSH
What I meant is that if you load the XML e4x, you have to analyze in a table to use it. You can retrieve the syntax of e4x XMLList and use it directly in your code. You can treat the XMLList almost as you treat any array using a for each loop for example.
Take the code below as an example and adapt it to your needs:
var mainMenu:XMLList = this.testXML.menu;
for each {var menu: XML (in mainMenu)}
trace ("Menu:" + menu.@txt);
You can use your logic to create menu main point here
var mynavItem:Navitem = new Navitem (0, spatie * i, GlobalVarContainer.my_array [i] [0], [i, 0], false, true);
this.holder.addChild (mynavItem); ABLE TO VIEW THE MAIN MENU
var items: XMLList = menu.children ();
If (items.length () > 0) {}
for each {var point: XML (in the points)}
trace ("point:" + item.@txt);
Logic of creation of subitem here
var mySubnavItem:Navitem = new Navitem (dash, spatie * (i + 1 + j), GlobalVarContainer.my_array [i] [2], [i, j], true);
this.holder.addChild (mySubnavItem); DISPLAYS ONLY THE LAST ENTRY IN THE SUBMENU
}
}
}
-
Center aligning images in table using the XML file
Hello
I use a flash file that uses an xml file to download a series of images one by one in a photo-gate.
There are two different widths of images. The height is always the same. Is it possible to set up so that each image that calls file xml is center aligned as part of image.
At the present time when using the xml file to load the image she always left aligns the image when he brings it in image even if you change the alignment to center align in the Panel align.
Does anyone have a suggestion why this happens or how to fix it?
Thanks for the helpI did this quickly and did not test - but if it does not directly at the exit it might give you a starting point - or someone else can correct if there are errors. I'll check tomorrow - where I am its time to go to sleep...
CHANGE the DETAILS: Just changed a few pieces of code I posted last night - I forgot to change the statement holder_mc.loadMovie in xml.onLoad Manager. I have not tested, but its along the lines of the approach I would use to solve your problem with resizing the image. Let me know how you go with it. -
Navigate trough different 'levels' in the XML file from the known item?
I am quite new to this, so I have to ask even if it's a stupid question...
I am trying to build a generic oracle procedure that can insert data into a table from a file XML so that message that it contains, but of course the messages has the same structure.
I need to find the first item after data, in this case "CUS_ORD_HEAD", but it could be any message as PO_HEAD.
So I need to somehow find the element without knowledge is the name of the element. It goes same for CUS_ORD_LINE that might be PO_LINE. Is it possible to navigate through the different 'levels' in the XML file from a known element.
< CustomerOrder >
< metadata >
< TransActionIdentity > 1 < / TransActionIdentity >
< / metadata >
< data >
< Client CUS_ORD_HEAD = 'ABC' CustomerOrderNumber '1234' = >
< CUS_ORD_LINE CustomerOrderNumber = "1234" OrderedQuantity = "10" ProductNumber = "1001403" CustomerOrderLinePosition = "1" / >
< HAPI_CUS_ORD_LINE CustomerOrderNumber = "1234" OrderedQuantity = "1" ProductNumber = "2530" CustomerOrderLinePosition = "2" / >
< CUS_ORD_LINE_TEXT CustomerOrderLinePosition = '2' Text = "Test" CUSTOMERORDERNUMBER = "1234" / >
< / HAPI_CUS_ORD_HEAD >
< / data >
< / CustomerOrder >the tablename parameter is identical to the XML element and attributes are the same as the columns
OK, understood.
You can retrieve the name of the element and attribute names in the same time by using something like the following.
Attribute names are stored in a collection that is accessible iteratively in order to build the dynamic parts of the query:SQL> CREATE OR REPLACE TYPE TColumnList IS TABLE OF VARCHAR2(30); 2 / Type created SQL> set serveroutput on SQL> SQL> DECLARE 2 3 xmldoc xmltype := xmltype(' 4
5 '); 18 19 --t_column_list TColumnList := TColumnList(); 20 --v_table_name VARCHAR2(30); 21 22 tmp_cols VARCHAR2(1000); 23 tmp_paths VARCHAR2(1000); 24 tmp_qry VARCHAR2(4000); 25 26 BEGIN 27 28 FOR r IN ( 29 SELECT table_name 30 , set(cast(collect(column_name) as TColumnList)) as column_list 31 FROM XMLTable( 32 'for $i in /CustomerOrder/Data/descendant::* 33 , $j in $i/attribute::* 34 return element e 35 { 36 element TABLE_NAME {name($i)} 37 , element COLUMN_NAME {name($j)} 38 }' 39 passing xmldoc 40 columns 41 table_name varchar2(30) 42 , column_name varchar2(30) 43 ) 44 GROUP BY table_name 45 ) 46 LOOP 47 48 tmp_cols := NULL; 49 tmp_paths := NULL; 50 51 --dbms_output.put_line(r.table_name); 52 53 FOR i in 1 .. r.column_list.count LOOP 54 55 tmp_cols := tmp_cols || ', ' || r.column_list(i); 56 tmp_paths := tmp_paths || ', ' || r.column_list(i) || ' varchar2(35) path ''@' || r.column_list(i) || ''''; 57 58 END LOOP; 59 60 tmp_cols := ltrim(tmp_cols, ', '); 61 tmp_paths := ltrim(tmp_paths, ', '); 62 63 tmp_qry := 'INSERT INTO ' || r.table_name || ' (' || tmp_cols || ') ' || 64 'SELECT ' || tmp_cols || 65 ' FROM XMLTable(''/CustomerOrder/Data/descendant::' || r.table_name || '''' || 66 ' PASSING :1 ' || 67 'COLUMNS ' || tmp_paths || 68 ')'; 69 70 dbms_output.put_line(tmp_qry); 71 72 END LOOP; 73 74 END; 75 / INSERT INTO CUS_ORD_HEAD (CustomerOrderNumber, Customer) SELECT CustomerOrderNumber, Customer FROM XMLTable('/CustomerOrder/Data/descendant::CUS_ORD_HEAD' PASSING :1 COLUMNS CustomerOrderNumber varchar2(35) path '@CustomerOrderNumber', Customer varchar2(35) path '@Customer') INSERT INTO CUS_ORD_LINE (CustomerOrderNumber, OrderedQuantity, ProductNumber, CustomerOrderLinePosition) SELECT CustomerOrderNumber, OrderedQuantity, ProductNumber, CustomerOrderLinePosition FROM XMLTable('/CustomerOrder/Data/descendant::CUS_ORD_LINE' PASSING :1 COLUMNS CustomerOrderNumber varchar2(35) path '@CustomerOrderNumber', OrderedQuantity varchar2(35) path '@OrderedQuantity', ProductNumber varchar2(35) path '@ProductNumber', CustomerOrderLinePosition varchar2(35) path '@CustomerOrderLinePosition') INSERT INTO CUS_ORD_LINE_TEXT (CUSTOMERORDERNUMBER, Text, CustomerOrderLinePosition) SELECT CUSTOMERORDERNUMBER, Text, CustomerOrderLinePosition FROM XMLTable('/CustomerOrder/Data/descendant::CUS_ORD_LINE_TEXT' PASSING :1 COLUMNS CUSTOMERORDERNUMBER varchar2(35) path '@CUSTOMERORDERNUMBER', Text varchar2(35) path '@Text', CustomerOrderLinePosition varchar2(35) path '@CustomerOrderLinePosition') PL/SQL procedure successfully completed6 8 91 710 16 1711 1213 1514 -
Automation of several Flash file by using the XML file 'mailing list '.
I created a Flash interactive multi-fichiers 'demo' for a client. It is very well as a Web site (although he doesn't use it as a Web site) in the way it is stated that there is an index page which can then direct you to product categories, which you can click to see. Each 'page' contains the product (or product category) information, photos, diagrams, etc. There is nothing of Flash animation.
My client also wants to be able to put in place so that the demo runs automatically in a configurable XML file. My ActionScript skills are fairly limited, but I was able to by using ActionScript 3 to load and read XML file. A loop using 'for', I am able to read the XML file and returns the path of each Flash file and the time that each file must be displayed (my client asked that he able to configure the duration of each page as well).
I created a charger for each video clip and a timer for the duration. Unfortunately, the thing that throws me off is that when I try to load the clip (as the last element in the loop for), it reads the entire XML file, returns all the clips and the durations (I use trace to see this) before loading the clip. Thus, the single loaded clip is the last reading of the XML file.
As I said, I'm not very good at ActionScript, so everything I managed to combine was internet tutorials.
This is my code:
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
var mcLoader:Loader = new Loader();
mcLoader.contentLoaderInfo.addEventListener (Event.INIT, playClip);var mcCurrent:MovieClip = new MovieClip();
stage.addChild (mcCurrent);var xml;
function playClip(e:Event):void
{
trace("Function:playClip");
stage.removeChild (mcCurrent);
mcCurrent = MovieClip (mcLoader.content);
mcLoader.unload ();
stage.addChild (mcCurrent);
}function xmlLoaded(e:Event):void
{
trace ("function: xmlLoaded");
XML = new XML (e.target.data);
var cl:XMLList = xml.clip;
for (var i: uint = 0; i < cl.length (); i ++)
{
trace ("Begin"for"loop");
trace ("variable" i "is" + i);clipPath var = cl[i].@path;
var delay = cl[i].@duration;trace ("Clip path is" + clipPath);
trace ("Display for" + delay);
mcLoader.load (new URLRequest (clipPath));
}
}xmlLoader.load (new URLRequest ("filerunlist.xml"));
I removed the timer event because, like all the rest was repeated until whatever it is obtained, so I wanted to figure out out to get the charger clip (mcLoader) to load the clip for each file, before I realized where put in the time to make sure each element is displayed for the appropriate duration. I suspect that the timer event must occur in the function "playClip", but that it would take advice on that as well.Thanks to anyone who can help me understand this.
You need to do in the service of parsing xml is just to store all data in a table. You will use while an array element after another through some timer control you set up, access each file in the order that they are stored in the table. You do not load in this function, all data storage, and when finished, the last line of this function outside the loop, fires at any function you have who begins to treat the first element of the array.
For example, to store the data objects in the array...
var clipData:Array = new Array(); store your data xml here
var clipToShow:uint = 0; use later in the function showClip
function xmlLoaded(e:Event):void
{
trace ("function: xmlLoaded");
XML = new XML (e.target.data);
var cl:XMLList = xml.clip;
for (var i: uint = 0; i
{
clipArray.push ({clipPath: cl[i].@path, delay: cl[i].@duration});}
showClip();
}function showClip() {}
Regardless of the process of loading .clipPath clipArray [clipToShow]
and using clipArray [clipToShow] .delay to start some timer is involved
the timer handler function calls this function when it is run
clipToShow += 1; increment the counter for the next clip online
}
If you are not comfortable/familiar with the approach of the object, then you could also store the clip and delay data in two separate tables.
-
HTTP Communication tutorial - parsing of the XML file error
Hello again,
I went through the tutorial of HTTP Communication today is here. Built just fine and it loaded into the Simulator, however when I hit refresh to load the XML from an HTTP network call I get the error:
XmlDataModel: Analysis of the file error... /... /.. /Data/model.XML on line 14, column 8: "unexpected character.
After the end of the XML file, given the location of the character of line 14, column 8 is that it really confused me.
Any thoughts on how to bypass this?
The XML file can be found at https://developer.blackberry.com/cascades/files/documentation/device_platform/networking/model.xml
try changing the url https://developer.blackberry.com/cascades/files/documentation/device_platform/networking/model.xml
-
RSS feeds save in the xml file in the device memory
Hello
I'm in the analysis of an RSS feed with SAX parser. Now, I want to record the first RSS an xml file in the memory of the device or on the SD card. Can someone guide me through this process
To write in an XML rss content, start by creating the file with the extension ".xml" with the help of the FileConnection API, then write content (rss data) in the XML file.
You can use code below to write the content in the file. We must give the path as a string & content in byte format.
public boolean writeFile(String path, byte[] data) { javax.microedition.io.Connection c = null; java.io.OutputStream os = null; try { c = javax.microedition.io.Connector.open("file:///" + path, javax.microedition.io.Connector.READ_WRITE); javax.microedition.io.file.FileConnection fc = (javax.microedition.io.file.FileConnection) c; if (!fc.exists()) fc.create(); else fc.truncate(0); os = fc.openOutputStream(); os.write(data); os.flush(); return true; } catch (Exception e) { return false; } finally { try { if (os != null) os.close(); if (c != null) c.close(); } catch (Exception ex) { ex.printStackTrace(); } } }
-
Hello
I use an XML file as the source in a map. This worked well until I changed the context during the execution of the mapping.
Initially, during the execution of the development, it worked without any problem. But when I changed the context to run the Test, he gave me the following error:-
ODI-1227: task load data-LKM SQL for Oracle-don't work not to connect to the source P6_ACTIVITIES - TEST.
Caused by: java.sql.SQLException: the object name already exists: P6ACTI_READACTIVITIESRESPONSE in the statement [create table P6ACTI_READACTIVITIESRESPONSE (READACTIVITIESRESPONSEPK NUMERIC (10) NOT NULL, SNPSFILENAME varchar (255) NULL, SNPSFILEPATH varchar (255) NULL, SNPSLOADDATE varchar (255) NULL)]
This object name, P6ACTI_READACTIVITIESRESPONSE created by ODI is a combination of scheme name defined in the JDBC URL properties (or the first five characters of the XML file) and the element root. Therefore, I don't have any control over the name, unless I have change the schema name property.
Restart the agent will solve the problem temporarily, but the error will appear again when the context is changed. My question is, how do I create/drop / let agent do this each time that the XML file is accessed ODI. I use ODI 12.1.3.
Thanks in advance,
Xmen
Only, you should be able to query code KM to understand if these tables are created, but generally it will be in the scheme of work specified on your server of intermediate technology.
We are not allowed to change the KMs, because it would create problems of alimony.
Who with Oracle or internally? A large part of ODI power lies in an open framework around KMs and as long as you develop and test carefully any customizations KM I really can't see why the support would be a problem. You can run the table to fall outside the knowledge module, would be - this also be a support issue, the main difference is that a KM custom allows to reuse easier?
-
I have a requirement to process a stream of xml files and load its content in the oracle as a name-value pair tables. Basically, my table has three columns ID, Detail_NM, Detail_val. I have to extract the ID and the corresponding details and store it in this table. The XML file looks like in below. I can use an extract sql but you are looking for the most effective way to do it. I would like to highlight the elements dynamically as an element may or may not be present in every game. for example. Second series below has address2 that isn't there in the first document set. Even if nothing new is introduced, I should be able to treat them without explicitly mentioning the name of the element. Is there a better way to deal with? Please, share your ideas. Thanks in advance
< document >
< id > 546534 < /ID >
< details >
the New York < City > < / City >
Ave de Rome 45 < address > < / address >
< zip > 10281 < / Zip >
< / details >
< / document >
< document >
< id > 6785565 < /ID >
< details >
Dallas < City > < / City >
< address > 56 locust ave < / address >
< Address2 > 2nd floor < / address >
< zip > 07454 < / Zip >
< / details >
< / document >
user626688 wrote:
Thanks again. Yes, we can have a node root
here. -What is the average size of a single XML entity? (Number of nodes, size in bytes)? -A file can be up to 2MB size. Each ID can have different elements from 0 to 200 under him. (Each document tag).
Sorry, missed your last answer once again.
If there is a root node, it is even simpler.
And you can certainly use an intermediate binary table of XMLType:
SQL> begin 2 3 -- insert as Binary XMLType 4 -- optional step for small files 5 insert into tmp_xml 6 values ( 7 xmltype(bfilename('TEST_DIR','sample2.xml'), nls_charset_id('AL32UTF8')) 8 ); 9 10 -- parse and insert into the target table 11 insert into my_table (id, detail_nm, detail_val) 12 select x1.id 13 , x2.detail_nm 14 , x2.detail_val 15 from tmp_xml t 16 , xmltable('/Documents/Document' 17 passing t.object_value 18 columns id number path 'Id' 19 , details xmltype path 'Details' 20 ) x1 21 , xmltable('/Details/*' 22 passing x1.details 23 columns detail_nm varchar2(256) path 'local-name(.)' 24 , detail_val varchar2(4000) path 'text()' 25 ) x2 ; 26 27 end; 28 / PL/SQL procedure successfully completed. SQL> select * from my_table; ID DETAIL_NM DETAIL_VAL ---------- -------------------- ------------------------ 546534 City New York 546534 Address 45 Rome Ave 546534 Zip 10281 6785565 City Dallas 6785565 Address 56 locust ave 6785565 Address2 2nd Floor 6785565 Zip 07454 7 rows selected.
-
How to import the xml file into bcc?
My input to atg file is xml containing assets of category or products.
I want the Scheduler to run to auto create a project and send an e-mail to the customer for approval.
When the client approves the xml file, and then run the Scheduler to get the data from the xml file into bcc.
I use: SingletonSchedulableService for this
Give me a direction for the same thing.
Thanks in advance.
I want to implement this in bcc.
What listener will listen to the authorization of the client for email (that contains the XML to import) we sent to him?
You will need to do a custom development to hang your workflow customized with incoming e-mail. To send notifications by mail electronic action is already there, and while creating his element within the ACC, you can specify a JSP page for the email template. You can view the rest of the relevant documents:
Oracle, Web ATG Commerce - Workflows
Oracle, ATG trade Web - action workflow items
I recommend you to consult the existing source of DeploymentEmailer in
\Publishing\samples\Java and see different types of DeploymentEvent and States can be used, based on your requirement in your custom component. See also these API javadocs for the process and the events of deployment available: DeploymentEvent (ATG Java API)
DeploymentServer (ATG Java API)
ATG has a component/atg/dynamo/service/POP3Service to retrieve messages from a POP3 e-mail server, but it is mainly used to detect the bounced email. Not too sure if it helps or adjustment in your case, but still you can go through all the details to know what is already there:
Bounced from Oracle ATG Web Commerce - E-mail
You can also check the event InboundEmail and API javadocs for InboundEmailMessage which are used in this function of rebound detection E-mail:
Oracle, ATG trade Web - InboundEmail event
InboundEmailMessage (ATG Java API)
Now based on all this, if you extend and customize a lot of things, that it would be little complex and tedious detect mail incoming approval based on its content and then advance your workflow. Another approach may be to put a URL in the e-mail template of your notification by e-mail that the approver will click and on the landing page, you can authenticate and advance your workflow to the needs.
Maybe you are looking for
-
Satellite Pro L300 create backup disks, TRDC Launcher error window
Error messages saying "no HARD disk recover space! "\n the Toshiba Recovery Disk create cannot be launched. This is a brand new machine and tried to make a backup of performed complete recovery, there were leaving them 1 C: Can anyone help? Thank you
-
repeatability of words in a table
I need logic for this program Count the number of words and number of repeat the words of the multi line text. Also display repeat them words in this chain. pls help me... Congratulations to ensure...
-
EPICS 2015 Client of e/s server on 64-bit LabVIEW
Hi guys,. Ich have installed LabVIEW Full Development System andLabVIEW 2015 2015 Full Development System 64 Bit SP1 on a 64-bit Win7 machine. Now, I want to install EPICS 2015 Client server of e/s (http://www.ni.com/download/labview-datalogging-and-
-
Cannot install Impossible Creatures
impossible creatures on vista I try to install impossible creatures on my computer with vista, I receive an error message when I try to launch the ic 1.0.1 patch English, it is said that there is a prolem with this windows package install. A program
-
HP Color LaserJet CP1217: Smoke when printing
What impression of this printer started smoking the crack where the printed paper emerges. I have turned off the machine and I'm worried about its use. There is no smell of burning smoke very well. What is the problem? I got the machine second hand,