XML file data
Hello
The attached xml file contains data that I would like to extract. The data value has the tag (ubchild???/)name of "mean'. This can occur quite a number of times within the file for different child names. e.g.
<Key>SENS0710:10951:IntSolIrr</Key> has the value as
<Mean>742.320755</Mean>
and
<Key>SMBAU008:154000347:m_S0 kWh</Key> has the value as
<Mean>227.458679</Mean>
and so on....
The attached vi is very very simple and uses the JKI EasyXML vi to parse the file to a labview data type.
This is the point at which I need some guidance as to move forward. I have looked at using variant to data, clusters etc, but can't seem to get anything near working.
Would somebody be so kind as to give me some advice or tips as to extract these values to an array.
Thankl you
Regards
Ray
Solved!
Go to Solution.
Attachments:
XMLReader.vi 8 KB
xml file for forum.pdf 151 KB
Hey Ray,
Here's how you use EasyXML to parse your data (Parse WebBox XML.vi):
Attachments:
Parse WebBox XML.vi 12 KB
Similar Messages
-
XML file data load to NW2004s-BI
HI,
I am trying to load the XML file data to NW2004s-BI .
I have created the file Data source, infosoucrce and data store object. I have maintained the transformation rule for data source and info source also for infosource and data store object.
But I am not able to create the XML DataSource (BW DataSource with SOAP Connection)
Could any one please help me
Thanks in advance.
AmitAmit
Welcome to SDN.
I don't know whether you checked this or not
Select your Infosource>right click change>goto Extras-->and select Create BW Data source with SOAP Connection. It will crete Datasource.
Hope this helps
Thanks
Sat
PS: Don't forget to assign points if the answer is useful. This is the way of telling thanks in SDN -
XML Processing (XML file data to ABAP internal table).
Hi,
I have a an XML file and i need to send the data to internal table. I suppose i have written the program correctly.
But the transformation program may not be correct.
So can one please tell me the transformation program c o d e or guide me to write the transformation code. Below are details of XML file and my program.
XML File
<?xml version="1.0" encoding="UTF-8" ?>
- <aeRequestOutputType>
+ <trackingInfo>
+ <JMSHeaders>
- <ns:__caret_reply_caret_ZBAPI xmlns:ae="http://www.tibco.com/" xsi:type="ns:__caret_reply_caret_ZBAPI_">
+ <RETURN>
- <T__TRADE__DATA>
- <item>
<BUKRS>1111</BUKRS>
<HKONT>22222</HKONT>
</item>
- <item>
<BUKRS>3333</BUKRS>
<HKONT>44444</HKONT>
</item>
</T__TRADE__DATA>
</ns:__caret_reply_caret_ZBAPI__TRADE__ACC__DOC__POST_caret_ZBAPI__TRADE__ACC__DOC__POST>
</aeRequestOutputType>
My Program
REPORT ZTEST13.
DATA : BEGIN OF itab OCCURS 0,
f(255) TYPE c,
END OF itab.
DATA : t001 TYPE TABLE OF ZTEST_ST_UB. "(structure has few variables like hkont,bukrs)
DATA: xmlupl TYPE string .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'c:\sap_output_xml.txt'
FILETYPE = 'ASC'
tables
data_tab = itab .
LOOP AT itab.
CONCATENATE xmlupl itab-f INTO xmlupl.
ENDLOOP.
CALL TRANSFORMATION ZTEST_ST_UB2
SOURCE XML xmlupl
RESULT root = t001.Hi,
use class cl_xml_document and method import_from_file inorder to read the xml file to internal table.
go trough this [LINK|http://wiki.sdn.sap.com/wiki/display/ABAP/UploadXMLfiletointernal+table] for detial code.
Regards,
Shanmugavel chandrasekaran -
Reading XML file using BAPI and then uploading that xml file data into SAP
I am getting a xml file from Java server. I need to take
data from this file using BAPI and need to upload into SAP using SAP.
Please tell me how to read XML files using BAPI's.<b>SDIXML_DATA_TO_DOM</b> Convert SAP data (elementary/structured/table types) into DOM (XML
<b>SDIXML_DOM_TO_XML</b> Convert DOM (XML) into string of bytes that can be downloaded to PC or application server
<b>SDIXML_DOM_TO_SCREEN</b> Display DOM (XML)
<b>SDIXML_DOM_TO_DATA</b>
data: it_table like t001 occurs 0.
data: l_dom TYPE REF TO IF_IXML_ELEMENT,
m_document TYPE REF TO IF_IXML_DOCUMENT,
g_ixml TYPE REF TO IF_IXML,
w_string TYPE XSTRING,
w_size TYPE I,
w_result TYPE I,
w_line TYPE STRING,
it_xml TYPE DCXMLLINES,
s_xml like line of it_xml,
w_rc like sy-subrc.
start-of-selection.
select * from t001 into table it_table.
end-of-selection.
initialize iXML-Framework ****
write: / 'initialiazing iXML:'.
class cl_ixml definition load.
g_ixml = cl_ixml=>create( ).
check not g_ixml is initial.
write: 'ok'.
create DOM from SAP data ****
write: / 'creating iXML doc:'.
m_document = g_ixml->create_document( ).
check not m_document is initial.
write: 'ok'.
write: / 'converting DATA TO DOM 1:'.
CALL FUNCTION 'SDIXML_DATA_TO_DOM'
EXPORTING
NAME = 'IT_TABLE'
DATAOBJECT = it_table[]
IMPORTING
DATA_AS_DOM = l_dom
CHANGING
DOCUMENT = m_document
EXCEPTIONS
ILLEGAL_NAME = 1
OTHERS = 2.
if sy-subrc = 0. write 'ok'.
else. write: 'Err =', sy-subrc.
endif.
check not l_dom is initial.
write: / 'appending DOM to iXML doc:'.
w_rc = m_document->append_child( new_child = l_dom ).
if w_rc is initial. write 'ok'.
else. write: 'Err =', w_rc.
endif.
visualize iXML (DOM) ****
write: / 'displaying DOM:'.
CALL FUNCTION 'SDIXML_DOM_TO_SCREEN'
EXPORTING
DOCUMENT = m_document
EXCEPTIONS
NO_DOCUMENT = 1
OTHERS = 2.
if sy-subrc = 0. write 'ok'.
else. write: 'Err =', sy-subrc.
endif.
convert DOM to XML doc (table) ****
write: / 'converting DOM TO XML:'.
CALL FUNCTION 'SDIXML_DOM_TO_XML'
EXPORTING
DOCUMENT = m_document
PRETTY_PRINT = ' '
IMPORTING
XML_AS_STRING = w_string
SIZE = w_size
TABLES
XML_AS_TABLE = it_xml
EXCEPTIONS
NO_DOCUMENT = 1
OTHERS = 2.
if sy-subrc = 0. write 'ok'.
else. write: 'Err =', sy-subrc.
endif.
write: / 'XML as string of size:', w_size, / w_string.
describe table it_xml lines w_result.
write: / 'XML as table of', w_result, 'lines:'..
loop at it_xml into s_xml.
write s_xml.
endloop.
write: / 'end of processing'.
end of code
Hope this will be useful.
regards
vinod -
Converting text String to XML file data
need some guidance. I have to create a XML file of a huge Text File.
I am parsing the text file according to relevance and passing a set of data each element and attribute seperated by "_".
I need to create to Xml file out this. It has to be current process as I need to keep on adding new elements and attributes.
e.g.
Passing this string
String temp("Name_Age_Birthdate_Birthplace_Place_teleNumber");
Need to add this to XML of format
<Directory>
<Person>
<Name>
<Age>
<Birthdate>.....
</Person>
<Person>
</Person>
</Directory>
The problem not all attributes may be present at some time..
e.g.
the person's age may be absent some times.. during that time the xml file should look like <Age/>
I will need to keep on updating Person list concurrently after the file has been created..
Need Urgent guidance.. I am still New to java
A guidance code or link is awaited..
Thanks.. a LotDo you need to stick to the XML support that comes with Java 1.4 or can you use Third-Party stuff? I'm asking, 'cause I think JDOM is much easier to use for a newbie than the build-in XML API ... and it comes with a VERY easy to use class XMLOutputter that creates XML files!
Take a look at JDOM:
http://www.jdom.org/ -
Hello
I am using Spry.Widget.AutoSuggest to sort the data from an
external XML file
In the XML there are some url-s pointing to pictures to be
loaded but the problem is that they all loads in the cache as the
page initializes.
Although they are not shown at the begining i can see them
caching ( firebug for mozilla)
Is there any way to load the appropriate pictures (data) just
after it matches the AutoSuggest search criteria.
the example files are :
http://www.evtinobg.com/newWebSite/_search.php
http://www.evtinobg.com/newWebSite/models.xml
thanx a lotPlease read the FAQ thread and posting guidelines... Also please see the XML DB basic demo.. And try forum search, this question (or variant's of it) have been asked and answered so many times that it's really not worth starting (another) new thread on this issue.
Edited by: mdrake on Jan 19, 2011 10:33 AM -
Most efficient way to load XML file data into tables
I have a complex XML file running into MBs. I want to load it's data into 7-8 tables.
Which way will be better:
1) Use SQL Loader to actually load directly into the 7-8 tables directly by modifying the control card.
Is this really possible and feasible? I am not even sure about it
2) Load data as XML Type in a table and register it. Then extract from there to load into various tables.
Please help. I have to find the most efficient way of doing it.
Regards,
SudhirYes it is possible to use SQL*Loader to parse and load XML, but that is not what it was designed for and so is not recommended. You also don't need to register a schema, just to load/store/parse XML in the DB either.
So where does that leave you?
Some options
{thread:id=410714} (see page 2)
{thread:id=1090681}
{thread:id=1070213}
Those talk some about storage options and reading in XML from disk and parsing XML. They should also give you options to consider. Without knowing more about your requirements for the effort, it is difficult to give specific advice. Maybe your 7-8 tables don't exist and so using Object Relational Storage for the XML would be the best solution as you can query/update tables that Oracle creates based off the schema associated to the XML. Maybe an External Table definition works better for reading the XML into the system because this process will happen just once. Maybe using WebDAV makes more sense for loading XML to be parsed (I don't have much experience with this, just know it is possible from what I've read on the forums). Also, your version makes a difference as you have different options available depending upon the version of Oracle.
Hope all that helps as a starter.
Edited by: A_Non on Jul 8, 2010 4:31 PM
A great example, see the answers by mdrake in {thread:id=1096784} -
Load xml file data in oracle 9i table
Hi,
I have oracle 9i R2 (9.2.0.8) and currently i am loading data using sql*loader as i am getting text file. I will be getting file in XML format shortly.
I would like tp know if there is a sql*loader way to load xml file or another easy method that i can use it?
If you can provide me very simplest way, i will really appreciate it.
Thanks,Please refer
http://download-uk.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb25loa.htm -
Hi,
I have to process a XLM file data from the application server. Could anyone give me any idea how to put the XML file from application server into an internal table in a proper way? I know there is a class CL_XML_DOCUMENT, but I have never handled a XML file before.If anyone could give me a sample code (my id is [email protected]), that would be very helpful.check out this weblog where in the code sample i am showing how a xml file can be converted to itab using XSLT (XSLT code is also given)
/people/durairaj.athavanraja/blog/2004/09/20/consuming-web-service-from-abap
Usefule linkg for learning XSLT
http://www.w3schools.com/xsl/
http://help.sap.com/saphelp_erp2005/helpdata/en/a8/824c3c66177414e10000000a114084/frameset.htm
also check out these packages from txn se80
SXSLT
SXSLT_APP
SXSLT_COMP
SXSLT_COMPMSG
SXSLT_DEBUGGER
SXSLT_DEMO
SXSLT_TEST
SXSLT_TOOL
SXSLT_TRAINING
Regards
Raja
Reward the helpful answers by clicking the radiobutton and if you question is answered mark it as answered -
Upload XML file data into internal table
Hi,
I need help from you.
I am uploading XML file from Application server.
1.In application server under directory it may have several XML files and i need to upload all the XML files when we gave only directory name. So, what is the function module for that logic . If possible code also.
2.Once we get the files into some internal table we need to upload data from that files to internal table.
So what is the logic for that , if possible code also.
I am giving sample directory:
For example in this directory assume 3 xml files are there.
I need to upload those files and data from that in to internal table.
Thanks & Regards
VSRBelow code will give you an idea.
TYPE-POOLS: ixml. "iXML Library Types
*TABLES : rbkp.
TYPE DECLERATIION
TYPES: BEGIN OF type_tabpo,
ebeln TYPE ekko-ebeln, "PO document number
ebelp TYPE ekpo-ebelp, "PO line item
END OF type_tabpo.
TYPES: BEGIN OF type_ekbe,
belnr TYPE rbkp-belnr, "Invoice document
gjahr TYPE rbkp-gjahr, "fiscal year
END OF type_ekbe.
TYPES: BEGIN OF type_invoice,
belnr TYPE rbkp-belnr, "PO document number
gjahr TYPE rbkp-gjahr, "Fiscal Year
rbstat TYPE rbkp-rbstat, "invoice status
END OF type_invoice.
TYPES: BEGIN OF t_xml_line, "Structure for holding XML data
data(256) TYPE x,
END OF t_xml_line.
INTERNAL TABLE DECLERATIION
DATA: gi_tabpo TYPE STANDARD TABLE OF type_tabpo,
gi_ekbe TYPE STANDARD TABLE OF type_ekbe,
gi_invoice TYPE STANDARD TABLE OF type_invoice,
gi_bapiret2 TYPE STANDARD TABLE OF bapiret2.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory.
DATA: l_xml_table TYPE TABLE OF t_xml_line, " XML Table of the structure
l_xml_line TYPE t_xml_line, " Record of structure t_xml_line
l_xml_table_size TYPE i. " XML table size
DATA: l_filename TYPE string.
WORK AREA DECLARATION
DATA: gw_tabpo TYPE type_tabpo,
gw_ekbe TYPE type_ekbe,
gw_invoice TYPE type_invoice,
gw_bapiret2 TYPE bapiret2.
BEGIN OF SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: p_file TYPE pathintern LOWER CASE DEFAULT '/usr/sap/tmp/'.
Validation of XML file: Only DTD included in XML document is supported
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION SCREEN VALIDATION
AT SELECTION-SCREEN.
To validate p_file is not initial
PERFORM sub_validate_file.
PERFORM sub_validate_path.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Request for filename for xml file from the application server
PERFORM sub_get_filename_appl USING p_file.
START OF SELECTION SCREEN
START-OF-SELECTION.
PERFORM sub_fetch_po_details.
PERFORM sub_get_invoice.
PERFORM sub_rel_invoice.
END OF SELECTION SCREEN
END-OF-SELECTION.
*& Form sub_validate_file
To Validate the file
FORM sub_validate_file .
IF p_file IS INITIAL.
MESSAGE e000. "specify the file path
ENDIF.
ENDFORM. " sub_validate_file
*& Form sub_get_filename_appl
form sub_get_filename_appl USING l_fname TYPE any.
DATA: l_fname TYPE filename-fileintern. " File name
*GET THE FILENAME FROM THE APPLICATION SERVER
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = l_fname
filemask = '*'
IMPORTING
serverfile = l_fname
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " sub_get_filename_appl
*& Form sub_fetch_po_details
To fetch the PO details from the application server
Format of file is XML
FORM sub_fetch_po_details .
TYPE DECLERATIION
l_ixml = cl_ixml=>create( ).
Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
PERFORM get_xml_table.
LOOP AT gi_tabpo INTO gw_tabpo.
WRITE:/ gw_tabpo.
ENDLOOP.
ENDFORM. " sub_fetch_po_details
*& Form get_xml_table
Read from the xml file
FORM get_xml_table .
Local variable declarations
DATA: l_len TYPE i,
l_len2 TYPE i,
l_tab TYPE tsfixml,
l_content TYPE string,
l_str1 TYPE string,
c_conv TYPE REF TO cl_abap_conv_in_ce,
l_itab TYPE TABLE OF string.
l_filename = p_file.
code to upload data from application server
OPEN DATASET l_filename FOR INPUT IN BINARY MODE.
IF sy-subrc 0.
WRITE:/ 'invalid file path'.
ENDIF.
DO.
READ DATASET l_filename INTO l_xml_line.
IF sy-subrc EQ 0.
APPEND l_xml_line TO l_xml_table.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET l_filename.
code to find the table size
DESCRIBE TABLE l_xml_table.
l_xml_table_size = ( sy-tleng ) * ( sy-tfill ).
*code to convert hexadecimal to XML
LOOP AT l_xml_table INTO l_xml_line.
c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data
replacement
= space ).
c_conv->read( IMPORTING data = l_content len = l_len ).
CONCATENATE l_str1 l_content INTO l_str1.
ENDLOOP.
l_str1 = l_str1+0(l_xml_table_size).
SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
LOOP AT l_itab INTO l_str1.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
l_str1 WITH space.
ENDLOOP.
CALL TRANSFORMATION ('ID') " code to put in internal table
SOURCE XML l_str1
RESULT tab = gi_tabpo[].
ENDFORM. " get_xml_table -
hi ,
I know how to load data from csv file...
Anyone can guide me for how to load data from xml file
i need step by step guidence
from
namanhi naman shah,
you can used XML DOM in SAP in order to read data from xml file
first step to do that, you need to read the xml file using OPEN DATASET
after that you convert the content of the file to XML DOM class in SAP using function modul SDIXML_XML_TO_DOM
after that you can read / manipulate the data from xml.
for the XML DOM class documentation in SAP, please refer to http://help.sap.com/saphelp_crm50/helpdata/en/bb/576637dca511d4990b00508b6b8b11/frameset.htm
hopes it helps
regards
eddhie -
How to search xml file data based on the given keyword from html form
hi,
i'm new to XML. I have this problem regarding searching within a XML file.
the
idea is that my search will be based on the keyword entered
in
by the user from a HTML form. the keyword is then used to search all
the
question nodes and the choice nodes within a XML file. once the match
is
found, i will have to display the results.
But i don't know how to do so - especially the part of searching xml file.
Can
anyone help me in this? Your help is much appreciated.
Edited by: Moti_Lal.D on Apr 4, 2008 7:28 AMyeah.. what i was trying to do is
i have one xml fine. then i have to read all the tag values say
<book>
<title>Java</title>
<author>agarwal</author>
<price>200</price>
</book>
<book>
<title>Xml</title>
<author>saxmann</author>
<price>300</price>
</book>
i can read the tag values like this
File file = new File("dom.xml");
try {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(file);
NodeList nodes = doc.getElementsByTagName"book");
for (int i = 0; i < nodes.getLength(); i++) {
Element element = (Element) nodes.item(i);
NodeList title = element.getElementsByTagName("title");
Element line = (Element) title.item(0);
what i want is i may give any xml file
like File file = new File("xxx.xml");
(it may be one level/two level/3level tagged one)
then the i should read all the tag values and store them in some array. Then when i enter some character from keyboard (say "a") then it has to show all the tag values starts with "a" and display them.
i guess u understand my problem. -
How can I set button colors from xml file data?
I am reading an xml file to create a group of buttons. I am
also using repeater to create the group of buttons.
I am getting the buttons created, but am unable to set the
fill color properly. I keep getting the error "Implicit coercion of
a value of type String to an unrelated type Array" if I try to plug
in r.currentItem.value, even when I used an Actionscript function
to convert from a String to an array of 2 uints. Is there a simple
type casting solution to this I'm just not getting?
Any help would be greatly appreciated!
The xml file has the following format:
<colors>
<color>
<name>Canteloupe</name>
<value>0xFFCC66</value>
</color>
<color>
<name>Banana</name>
<value>0xFFFF66</value>
</color>
<color>
<name>Lemon</name>
<value>0xFFFF00</value>
</color>
<color>
<name>Honeydew</name>
<value>0xCCFF66</value>
</color>
</colors>
The code I have so far is:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
initialize="colors.send()" layout="absolute">
<mx:HTTPService id="colors"
url="assets/colors_standard.xml" resultFormat="e4x"/>
<mx:XMLListCollection id="xlc_colors"
source="{colors.lastResult.color}"/>
<mx:TabNavigator left="0" top="0" right="0"
bottom="0">
<mx:Canvas label="Tab 1" width="100%" height="100%">
<mx:Accordion width="200" left="0" top="0" bottom="0">
<mx:Canvas label="Colors" width="100%" height="100%">
<mx:Label text="Current Color Selection" left="10"
right="10" top="10" height="20" fontWeight="bold"/>
<mx:Button label="Update Colors" left="10" right="10"
top="227" height="22" id="button_colors_update"/>
<mx:Canvas height="189" left="10" right="10" top="30"
borderStyle="outset" backgroundColor="#e9e9e9">
<mx:Tile id="tile_standard" direction="horizontal"
tileWidth="25" tileHeight="25" horizontalAlign="center"
verticalAlign="middle" borderStyle="outset" left="10" right="10"
top="10" height="134" backgroundColor="#ffffff">
<mx:Repeater id="r" dataProvider="{xlc_colors}">
<mx:Button toolTip="{r.currentItem.name}" height="15"
width="15" x="10" y="10"/>
</mx:Repeater>
</mx:Tile>
<mx:Button label="Additional Colors"
id="button_colors_online" height="22" left="10" right="10"
bottom="10"/>
</mx:Canvas>
</mx:Canvas>
</mx:Accordion>
</mx:Canvas>
</mx:TabNavigator>
</mx:Application>Thanks atta707!
If I send an array of 2 uints via a function call that
converts from String to Number to uint in an Actionscript function
and try to feed that into fillColors via:
<mx:Script>
<![CDATA[
public function fillcolors (_colorvalue:String):uint {
return uint(Number(_colorvalue));
]]>
</mx:Script>
<mx:Button height="15" width="15"
toolTip="{r.currentItem.name}" x="10" y="10"
fillColors="[fillcolors({r.currentItem.value}),fillcolors({r.currentItem.value})]"
I still get the "Implicit coercion of a value of type String
to an unrelated type Array." on the line that creates the button. I
have tried returning an Array of two uints with the Actionscript
funtion and get the same result.
<mx:Script>
<![CDATA[
public function fillcolors (_colorvalue:String):Array {
return new Array(uint(Number(_colorvalue)),
uint(Number(_colorvalue)));
]]>
</mx:Script>
<mx:Button toolTip="{r.currentItem.name}" height="15"
width="15" x="10" y="10"
fillColors="[fillcolors({r.currentItem.value})]"/>
Am I mistaken in my conversion of r.currentItem.value to
fillColors as arguments? Sorry about the newbie question - the
error I get makes me think it is a type conversion issue, but I
can't seem to get this to work/compile. If fillColors is expecting
an Array, should the Actionscript function returning an Array at
least get this to compile? -
Hi,
I want to parsing an xml file and putting in a table.
Please help, if anybody have sample code, please send me on [email protected] ASAP.
Thanks in advance.
RD.Hi,
I want to parsing an xml file and putting in a table.
Please help, if anybody have sample code, please send me on [email protected] ASAP.
Thanks in advance.
RD. -
Hi All,
Please can you give an idea how to fech xml data..I wanto fetch all <POL_NO> tag data in a temp table.
My sample xml:
<POL>
<Polinfo>
<POL_NAME>COMP1</POL_NAME>
<POL_NO>100</POL_NO>
</Polinfo>
</POL>
<POL>
<Polinfo>
<POL_NAME>COMP2</POL_NAME>
<POL_NO>101</POL_NO>
</Polinfo>
</POL>
<POL>
<Polinfo>
<POL_NAME>COMP3</POL_NAME>
<POL_NO>102</POL_NO>
</Polinfo>
</POL>
<POL>
<Polinfo>
<POL_NAME>COMP4</POL_NAME>
<POL_NO>103</POL_NO>
</Polinfo>
</POL>
Thanks,The EXTRACTVALUE and XMLSEQUENCE method is deprecated in 11g, and from 10g you would be better using the XMLTABLE method:
SQL> ed
Wrote file afiedt.buf
1 with t as (select xmltype('<root>
2 <POL>
3 <Polinfo>
4 <POL_NAME>COMP1</POL_NAME>
5 <POL_NO>100</POL_NO>
6 </Polinfo>
7 </POL>
8 <POL>
9 <Polinfo>
10 <POL_NAME>COMP2</POL_NAME>
11 <POL_NO>101</POL_NO>
12 </Polinfo>
13 </POL>
14 <POL>
15 <Polinfo>
16 <POL_NAME>COMP3</POL_NAME>
17 <POL_NO>102</POL_NO>
18 </Polinfo>
19 </POL>
20 <POL>
21 <Polinfo>
22 <POL_NAME>COMP4</POL_NAME>
23 <POL_NO>103</POL_NO>
24 </Polinfo>
25 </POL>
26 </root>') as xml from dual)
27 --
28 -- end of test data
29 --
30 select x.*
31 from t
32 ,xmltable('/root/POL'
33 passing t.xml
34 columns pol_name varchar2(10) path './Polinfo/POL_NAME'
35 ,pol_no number path './Polinfo/POL_NO'
36* ) x
SQL> /
POL_NAME POL_NO
COMP1 100
COMP2 101
COMP3 102
COMP4 103
Maybe you are looking for
-
Where can i download a driver for HP PC 1400 that will install on my mac
I can download a package from HP that says it will install the software needed to install on my mac (running ver 10.8.2) but even when I override the allow package to be installed from anyone, it doesn't work. anybody know abou
-
Tascam US2400 NOT compaible with Leopard.
Unfortunatly the Tascam US2400 isnt working the way it should in L8+Leopard, Works fine under Tiger. Unit is recognized and works (sort of), there is alot of led-flickering on the "v"-pots. And most annoying, the faders aren fysically updated when sw
-
IPhone 4 Failed passcode attempts
I gave an old iPhone 4 to a friend, and a small child repeatedly entered an incorrect passcode. I am attempting to restore the phone for this person using my iTunes (which it was last synced to, with current iPhone updates as of a month or so ago) ho
-
Identifying image and video file names in my presentation
I want to identify the file names of all the images and videos in my Keynote presentation so that I can re-assemble the presentation in Final Cut Pro . . . I thought that just using Inspector might give me the file names, but it only shows me what t
-
Can anyone help me get my version of FM 10 updated with the TCS3Update.zip patch?
I'm trying to get FM 10 working on my new computer, but after installation when I go to open the program I get the "Licensing for this product has expired" message. I downloaded the TCS3Update.zip patch the website recommended to fix this, but when I