Split XML into multiple records
Hi All,
I have to split an XML field from a data type into multiple records on the target side.
For eg: If the source XML string is something like this:
<XML_STRING>
<Data>
<name>abc</name>
<place></place>
<addr1> </addr1>
<addr2></addr2>
</place>
<name>xyz<name>
<place>
<addr1></addr1>
<addr2></addr2>
</place>
</Data>
</XML_STRING>
Since the above XML string has two records in it (each record includes name and place), I would like to split those two into two separate records in the target structure and send it to ECC.
How can I achieve this in PI mapping. Here in this case I cannot even differentiate between <> </> to split the messages since a single records might have multiple sub nodes in it. It is only believed that when "<name>" repeats again in the XML that would be a start of new record. Based upon that I need to split the records.
Thanks in advance!!
Hi Shweta,
Minor correction is required for you source structure. Please follow Amit or Vila suggestion for content conversion.
Did mapping as per your requirement. Please find the screen shot below. Please note the structure and cardinality of the element and node field.
Hope result is as per your requirement.
Regards
Jitender
Similar Messages
-
In Acrobat 9 Pro, How do you split xml into multiple forms?
Greetings,
I'm new to Acrobat & xml in general. I'm trying to take one data file containing multiple copies of xml forms for importing in to Acrobat Pro. It keeps failing with the second xml header. The following is a sample of the data file.
<?xml version="1.0" encoding="UTF-8" ?>
<fields>
<CaseNumber>00-12345</CaseNumber>
<SendToNameAndCareOf>Somebody
.</SendToNameAndCareOf>
<SendToAddr>Address here</SendToAddr>
<SendToCityStZip>City, St, Zip</SendToCityStZip>
</fields>
<?xml version="1.0" encoding="UTF-8" ?>
<fields>
<CaseNumber>00-67890</CaseNumber>
<SendToNameAndCareOf>Somebody else
</SendToNameAndCareOf>
<SendToAddr>Another Address</SendToAddr>
<SendToCityStZip>City, St, Zip</SendToCityStZip>
</fields>
Is there anyway to accomplish this using the basic functionality of importing xml?Actually Graffiti it might be able to be done via 'touchup tool' without creating a new PDF. Assuming of course a photo editor like Photoshop is present.
To the OP: Acrobat is intended as final destination format and not really suitable for editing (although minor changes can be made with the full Acrobat product). It's always best to do the changes to the original document and then make a new PDF making sure you acknowledge proper version control procedures. Changing the PDF means that you now have a PDF that doesn't match the original document. -
Insert Insert XML file into multiple records in Oracle Database
I would like to find out if it is possible to insert a single XML file into multiple records or tuples in a Oracle database table. I have a single XML file which is at multiple levels. The meta data for the levels are common and each level can have meta data of their own in addition. I do not have any meta data field which will uniquely determine whether the data belongs to Root level, Intermediate level or at the document level. Is there any way I can determine which level the meta data belongs to and thereby make a corresponding entry into the database table tuple? For example I could have an attribute called level which is going to be present only in the database table and not in the XML file. If level=1 then it corresponds to "Root" meta data, if level=2 then it corresponds to "Intermediate" level and if level=3 then it corresponds to meta data at document level. I need a way to calculate the value for level from the XML file and thereby insert the meta data element into a tuple in a single table in Oracle.
Hi,
extract your xml and then you can use insert all clause.
here's very small example on 10.2.0.1.0
SQL> create table table1(id number,val varchar2(10));
Table created.
SQL> create table table2(id number,val varchar2(10));
Table created.
SQL> insert all
2 into table1 values(id,val)
3 into table2 values(id2,val2)
4 select extractValue(x.col,'/a/id1') id
5 ,extractValue(x.col,'/a/value') val
6 ,extractValue(x.col,'/a/value2') val2
7 ,extractValue(x.col,'/a/id2') id2
8 from (select xmltype('<a><id1>1</id1><value>a</value><id2>2</id2><value2>b</value2></a>') col from dual) x;
2 rows created.
SQL> select * from table1;
ID VAL
1 a
SQL> select * from table2;
ID VAL
2 b Ants -
Split a record into multiple records
Hi,
I have situation where i need to split a record into multiple records.
InputData :
value|BeginDate |EndDate
15 |2002/10/15|2002/10/16
13 |2002/10/13|2002/10/20
19 |2002/10/19|2002/10/23
10 |2002/10/10|2002/10/12
OutPut :
10 |2002/10/10|2002/10/12
13 |2002/10/13|2002/10/15
15 |2002/10/15|2002/10/16
13 |2002/10/16|2002/10/19
19 |2002/10/19|2002/10/23
ThanksHi ,
As a far I understood from your example ,
I have few questions...
1. You have information about the patient in a 1 source table.
2. how u are identifying for patient X u need 5 rows to be created. R u storing these informations in seprate table or how ...
3. if you have these information in a seperate tables ..... a simple cross join in ODI should get you the expected result.....
Or give some more information with a example ..that would be great ...
Thanks -
i use Exchange to sync my iphone4S with Outlook. On my iphone, my contacts are split into multiple records if they have more than one email address - how can I consolidate them on the iphone
I have loaded my Firefox bookmarks into Internet Explorer Favorited. I also uninstalled Safari.
I go to iTunes on my phone and see no wat to connect my iPhone to my laptop. I see Music, Shows, etc., the kind of stuff I would expect, but no clue as to how to proceed.
Would you please be so kind to fill me in on how to "That syncing is done via iTunes. Connect the device to iTunes, select it, then go to the Summary page and select to sync bookmarks."?
I am not sure what you mean by "Summary Page"
Thank you -
Split a record into multiple records (rows)
I am using ODI to move data from source system to target system .Both are Oracle . In the source system I have a record which I need to split into multiple records or rows in the target system based on some rules . How can I achieve this in ODI . Please explain
Hi ,
As a far I understood from your example ,
I have few questions...
1. You have information about the patient in a 1 source table.
2. how u are identifying for patient X u need 5 rows to be created. R u storing these informations in seprate table or how ...
3. if you have these information in a seperate tables ..... a simple cross join in ODI should get you the expected result.....
Or give some more information with a example ..that would be great ...
Thanks -
Split XML in Multiple XML files with Java Code
Hi guys , i have following xml file as input ....
<?xml version="1.0" encoding="ISO-8859-1"?>
<T0020
xsi:schemaLocation="http://www.safersys.org/namespaces/T0020V1 T0020V1.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.safersys.org/namespaces/T0020V1">
<INTERFACE>
<NAME>SAFER</NAME>
<VERSION>04.02</VERSION>
</INTERFACE>
<TRANSACTION>
<VERSION>01.00</VERSION>
<OPERATION>REPLACE</OPERATION>
<DATE_TIME>2009-09-01T00:00:00</DATE_TIME>
<TZ>CT</TZ>
</TRANSACTION>
<IRP_ACCOUNT>
<IRP_CARRIER_ID_NUMBER>274845</IRP_CARRIER_ID_NUMBER>
<IRP_BASE_COUNTRY>US</IRP_BASE_COUNTRY>
<IRP_BASE_STATE>AR</IRP_BASE_STATE>
<IRP_ACCOUNT_NUMBER>55002</IRP_ACCOUNT_NUMBER>
<IRP_ACCOUNT_TYPE>I</IRP_ACCOUNT_TYPE>
<IRP_STATUS_CODE>100</IRP_STATUS_CODE>
<IRP_STATUS_DATE>2007-11-06</IRP_STATUS_DATE>
<IRP_UPDATE_DATE>2009-08-03</IRP_UPDATE_DATE>
<IRP_NAME>
<NAME_TYPE>LG</NAME_TYPE>
<NAME>A P SUPPLY CO</NAME>
<IRP_ADDRESS>
<ADDRESS_TYPE>PH</ADDRESS_TYPE>
<STREET_LINE_1>1400 N OATS</STREET_LINE_1>
<STREET_LINE_2/>
<CITY>TEXARKANA</CITY>
<STATE>AR</STATE>
<ZIP_CODE>71854</ZIP_CODE>
<COUNTY>MILLER</COUNTY>
<COLONIA/>
<COUNTRY>US</COUNTRY>
</IRP_ADDRESS>
<IRP_ADDRESS>
<ADDRESS_TYPE>MA</ADDRESS_TYPE>
<STREET_LINE_1>P O BOX 1927</STREET_LINE_1>
<STREET_LINE_2/>
<CITY>TEXARKANA</CITY>
<STATE>AR</STATE>
<ZIP_CODE>75504</ZIP_CODE>
<COUNTY/>
<COLONIA/>
<COUNTRY>US</COUNTRY>
</IRP_ADDRESS>
</IRP_NAME>
</IRP_ACCOUNT>
<IRP_ACCOUNT> ..... </IRP_ACCOUNT>
<IRP_ACCOUNT> ..... </IRP_ACCOUNT>
<IRP_ACCOUNT> ..... </IRP_ACCOUNT>
</T0020>
and i want to take this xml file and split it into multiple files through java code like this ...
File1.xml
<T0020>
<IRP_ACCOUNT> ..... </IRP_ACCOUNT>
<IRP_ACCOUNT> ..... </IRP_ACCOUNT>
</T0020>
File2.xml
<T0020>
<IRP_ACCOUNT> ..... </IRP_ACCOUNT>
<IRP_ACCOUNT> ..... </IRP_ACCOUNT>
</T0020>
like wise...
Each xml file contain maximum 10 or 15 IRP_ACCOUNT.
Can somebody please help me ? How can i do it with stax like start element and all ?
thanks in advance.Ah, sorry, strike that. You want multiple files. I think the easiest way is to simply parse with DOM. [http://www.w3schools.com/xpath/default.asp] . And here [http://www.w3schools.com/xpath/default.asp].
You can output the various XML elements using a PrintWriter or creating a separate DOM document for each file you want to create and serializing that.
- Saish -
Splitting TempDB into multiple data files.
To avoid contention we have to split tempdb into multiple data files. But as for case suppose, there is 20 GB total space is on the drive containing 1 tempdb data file of 15 GB. And I have to create 3 more tempdb data files, and as recommendation all files
should be of same size.Then how to handle this situation and configure all data files with same size?
Pranshul GuptaBut as for case suppose, there is 20 GB total space is on the drive containing 1 tempdb data file of 15 GB. And I have to create 3 more tempdb data files, and as recommendation all files should be of same size.Then how to handle this situation and configure
all data files with same size?
So your goal is to have 4 tempdb files, each 5GB? Below is a sample script to accomplish the task within the 20GB space constraint.
--reduce size of existing file to 5GB
ALTER DATABASE tempdb
MODIFY FILE (NAME='tempdev', Size=5GB);
DBCC SHRINKFILE('tempdev',5120);
--add 3 new 5GB files
ALTER DATABASE tempdb
ADD FILE (NAME='tempdev2', FILENAME='D:\SqlDataFiles\tempdb2.ndf', Size=5GB);
ALTER DATABASE tempdb
ADD FILE (NAME='tempdev3', FILENAME='D:\SqlDataFiles\tempdb3.ndf', Size=5GB);
ALTER DATABASE tempdb
ADD FILE (NAME='tempdev4', FILENAME='D:\SqlDataFiles\tempdb4.ndf', Size=5GB);
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
Tag an UCM document into multiple records
What is the best way to tag a document into multiple records in UCM 11g ? In my webcenter application , a builder having site with many plots (say 100) wants a document in UCM to be tagged against some selective plots(say 1-10). He can again change the tagging (ie. he can add more plots or remove the tag from existing etc) . Each home owner will have either one or more plots . When the home owner logs in, he should be able to see that document which is tagged against that plot.
Thanks ....Hi wilsonea,
You're probably thinking of InDesign's Data Merge function. Here are two links that may help you decide if this is what you're thinking of doing:
InDesign Help | Data merge
How to data merge in InDesign tutorial - YouTube
If this is what you're thinking of, you'll need the design laid out in InDesign and a CSV file. The above YouTube video provides a decent instructions on this.
When you save your Excel file as a CSV file, I recommend that you also save it as a XLS (not XLSX) file too. The CSV file will not save any formatting (like column widths and cell formatting), which makes it difficult to read the cell content whenever I have to use the file often.
Hope this helps. Cheers! -
Splitting the single record into multiple records based on validity
Hi Guru's,
basically i am an BI consultant with less knowledge on ABAP, can i request your help on the ABAP task.
I am working on HR module which is integrated with SAP BI, the reports will be executed based on calendar month the requirement is i should split the single record into a multiple records based on validity of the record. basically the HR data would be in data from and date to.
below is the logic
Check whether the start and end date of the record are in the same month and year.
If yes nothing changes
If no create multiple records
1st record original start date of the record u2018till end of that month
Following record 1st of the next month u2018till last day of the month
u2026
Last record 1st of the month u2018till original end date.
All fields will have the same values, only the datefrom and dateto fields change.
Can any one please provide me the same code to proceed on my task.
Thanks and Regards,
VenkatHi,
Using Rule group we can split it.
Using Rule Group in SAP-BI Part - 1
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/business-intelligence/s-u/using%20rule%20group%20in%20sap-bi%20%20part%20-%201.pdf
Thanks
Reddy -
Split one record into multiple records in Update Rules
Hello All,
I am trying to split a single record from R/3 into 2 records.
My data flow is form R/3 > PSA > ODS > Cube
when loading data into ODS i have to add the original record as it is to ODS. For second record i have to check a condition, & change few keyfigure values to 0 and fill an extra field.
Example:
Record in R/3 :
Month | %1 | %2 | %3 | % 4 | ORGUNIT | JOB| EMPLOYEE| POSITION|
02.2006 | 0 | 1 | 0 | 0 | 3000000| 248 | 2546352 | 500000 |
Record in BW Comm_Structure.
In Transfer rules i m writing an extra field to the R/3 record.
Month | %1 | %2 | %3 | % 4 | ORGUNIT | JOB| EMPLOYEE| POSITION| NEW_FIELD |
02.2006 | 0 | 1 | 0 | 0 | 3000000| 248 | 2546352 | 500000 | 2546352 |
NEW_FIELD transfer routine :
If employee NE 0
Result = employee
else.
Result = 0 .
Till this point everything works fine.
Now i want to load this record into an ODS. I want to split the above single record into 2 records.
Records in ODS should be :
Month | %1 | %2 | %3 | % 4 | ORGUNIT | JOB| EMPLOYEE| POSITION| NEW_FIELD |
02.2006 | 0 | 1 | 0 | 0 | 3000000| 248 | 2546352 | 500000 | 0 |
02.2006 | 0 | 0 | 0 | 0 | 3000000| 248 | 2546352 | 500000 | 2546352 |
Condition for NEW_FIELD.
For first record always NEW_FIELD =0.
For Second Record
If NEW_FIELD NE 0.
Cahnge KF's %1, %2, %3, %4 = 0.
If EMPLOYEE is 0 then no need to create extra record.
I tried to use achieve this using return table, but no success.
Can any one help me with ABAP syntax please. I am bit weak in ABAP Programming.
Thanks in advance.
POPSDear:
You could do so in update routines. Select the 'return table' option.
useful links:
https://forums.sdn.sap.com/click.jspa?searchID=10118555&messageID=2906656
https://forums.sdn.sap.com/click.jspa?searchID=10118555&messageID=913873
https://forums.sdn.sap.com/click.jspa?searchID=10118555&messageID=2441579
Thanks -
Adapter file sender doesn't split file into multiple message
Hi everybody.
We are in PI 7.0 SP10.
In adapter file sender, I want to split a file into multiple file.
We use protocole "file content conversion"
in the field "recordset per message", I put the value 10 to test.
The file content 30 records .
The result we have is the treatment is not split into multiple message .
The treatment is made but with one message.
I need to treat big files.
Is there some one who have an idea why t doesn't work ?
Thanks in advance for your help.
Regards
Edited by: Eric KOralewski on Jun 25, 2009 3:14 PMHi,
have you specified recordset name......if not, then specify it.............
in recordset structure, specify like RECORD,1 and not RECORD,*
again test your scenario......if still your file data is not getting split, then ask your basis guys to do a full CPACache refresh using PIDIRUSER..........your basis guys will know how to do it..........then again test your scneario............
Regards,
Rajeev Gupta -
Split file into multiple Instance of an IDoc .
My file (only one file) in the file system contains multiple entities(lets say sales order).Now using File adapter I want to transfer this file into XI and want XI to create multiple instance of an IDoc(for each sales order) and send them to the target system one by one.
Alternatively can I split the file into multiple entities(sales order) in the file adapter (using dispatcher for e.g) and send multiple message to the configured XI automatically.
Is any of the alternative possible in XI20.
Any responce would be highly appreciated.
Regards,
Bikky.Hi,
You can get the file adapter to split the file without the need for a dispatcher user exit. The config goes a little like this:
mode=FILE2XMBWITHSTRUCTURECONVERSION
xml.recordsetStructure=SALES_ORDER,1
xml.recordsetsPerMessage=1
This last parameter ensures each sales order is posted to the integration engine as a separate message. Therefore a separate Idoc is created for each.
Hope this helps.
Jason -
This is my first thread so I hope I have formatted my request appropriately...
If I have a simple XML doc with several records (see below) what is the best / easiest way to insert the data into multiple tables (Oracle 10g Release 1)?
For example 3 tables:
PATIENT table (CLAIMID, FNAME, LNAME, HEALTHNUM)
ADDRESS table (CLAIMID, STREET, CITY, PROVINCE)
SERVICE table (CLAIMID, SERVICE, ADMITDATE, DEPARTDATE)
<?xml version="1.0"?>
<CLAIMS>
<CLAIM>
<CLAIMID>1</CLAIMID>
<FNAME>Oscar</FNAME>
<LNAME>Grouch</LNAME>
<HEALTHNUM>1234657890</HEALTHNUM>
<STREET>123 Sesame Street</STREET>
<CITY>Sesameville</CITY>
<PROVINCE>ON</PROVINCE>
<SERVICE>Heart Surgery</SERVICE>
<ADMITDATE>2007-06-05</ADMITDATE>
<DEPARTDATE>2007-06-11</DEPARTDATE>
</CLAIM>
<CLAIM>
<CLAIMID>2</CLAIMID>
<FNAME>Poppa</FNAME>
<LNAME>Smurf</LNAME>
<HEALTHNUM>0987654321</HEALTHNUM>
<STREET>44 Blue Street</STREET>
<CITY>Smurfville</CITY>
<PROVINCE>ON</PROVINCE>
<SERVICE>Lung Transplant</SERVICE>
<ADMITDATE>2007-05-28</ADMITDATE>
<DEPARTDATE>2007-06-04</DEPARTDATE>
</CLAIM>
...more <CLAIM> records
</CLAIMS>
I can import the XML document into an XMLType column but don't know where to go from there...
The extractValue method seems to work only when there is a single claim record in the XML document but a typical document will contain several hundred claims.
Thanks in advance,
M KentUse the Oracle Berkeley DB XML to store the XML document in a embedded xml database. To store in the Oracle 10g database use XSU. With XSU an XML document may also be stored in multiple tables.
http://download-east.oracle.com/docs/cd/A97329_03/web.902/a88894/adx07xsu.htm#1016732 -
How to Split field into multiple fields in Import Manager without delem
Hi
Is there any method to Split a record in MDM without using delimitter?
I dont want to use any delemitter My field content in Source is PRODLABELPACK and I want to split it into 3 fields in destination Field1= PROD
Field2=LABEL Field3=PACK
I know how to split it if the content is PROD_LABEL_PACK .But we dont want to use delimiter in the firld and want to use some substring function
Regards
PrashantYou Can use below FM SWA_STRING_SPLIT -
First Use READ_TEXT FM.
then loop into
loop at tline.
Here use 'SWA_STRING_SPLIT' -> Pass tdline and append the text into other internal table.
endloop
Thank you
Seshu
Maybe you are looking for
-
Could I have CASE or IF statement in FMS queries?
Is it possible to have case statements in FMS queries: For example: SELECT T0.[U_DepoistfeeON] case when T0.[U_DepoistfeeON] is NOT BLANK then $[$38.111.160]='Deposit Fee' when T0.[U_DepoistfeeON] is BLANK then then $[$38.111.160]=BLAN
-
Locale Error Message After Todays Update [Solved]
I experienced an error message regarding something about cannot locale en-US.UTF8 after an update and reboot today. I got rid of the error message by uncommenting: en_US.UTF-8 UTF-8 en_US ISO-8859-1 in /etc/locale.gen Prior to fix: $ locale locale:
-
Sparc Solaris 10 luactivate & sync -- very slow !!!
System: Sun Fire T2000 4-Core UltraSPARC T1 OS: Solaris 10 (upgrading from 6/06 to 8/07 with current Cluster Patch applied) HDD: two internal SATA drives Subsystems: iSCSI SANs attached virtual HDDs * followed instructions as outlined in Solaris 10 H
-
How to create blocks on Procedures? How does one handle I/U/D on the block?
Hello Gurus, How to create blocks on Procedures? How does one handle I/U/D on the block? Please give an example. Thank You,
-
Cisco Auto Update Failure - Problem @ Cisco??
Hello, My sensor has stopped doing auto updates & there's been no config changes on the sensor. When tyring to access the update URL via a web browser I get the following error: We are unable to process your request at this time. Please try again lat