Generate XML file with Elements and attributes from Oracle table
Hi,
I have the following table structure.
CREATE TABLE COIL
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),
DOCUMENT_DATE DATE,
DOCUMENT_STATUS VARCHAR2(15),
DOCUMENT_TYPE VARCHAR2(20),
DOCUMENT_SOURCE VARCHAR2(20),
TEST_ID NUMBER(38),
VALUE NUMBER,
TEST_UOM VARCHAR2(20),
TEST_STATUS VARCHAR2(70),
TESTER_LOGIN VARCHAR2(20),
EQUIPMENT_CODE VARCHAR2(50),
DOC_STS_MSG VARCHAR2(600)
For each COILID record, there could be multiple records baased on TEST_ID/VALUE/TEST_UOM etc.
And I would like to prepare xml file in the following format by selecting data from 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>
<CoilPOOperatingUnit>Changzhou</CoilPOOperatingUnit>
<CoilPONo>4619</CoilPONo>
<MillNo>86</MillNo>
<MillCoilStatus>Test</MillCoilStatus>
<ItemNo>050FP800 C5</ItemNo>
<Weight>7076</Weight>
<UOM>KILOGRAM</UOM>
<DocumentNo>0</DocumentNo>
<DocumentDate>2013-01-11</DocumentDate>
<DocumentStatus>NonProcessed</DocumentStatus>
<DocumentType>Tests</DocumentType>
<DocumentSource>CHIGMA1</DocumentSource>
<Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.4992" TestUnit="mm" Status="NonProcessed" TestId="135"/>
<Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.0128" TestUnit="mm" Status="NonProcessed" TestId="124"/>
<Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="12" TestUnit="mm" Status="NonProcessed" TestId="125"/>
<Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.5095" TestUnit="mm" Status="NonProcessed" TestId="127"/>
<Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.5042" TestUnit="mm" Status="NonProcessed" TestId="128"/>
<Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.5058" TestUnit="mm" Status="NonProcessed" TestId="129"/>
<Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.4967" TestUnit="mm" Status="NonProcessed" TestId="130"/>
<Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.5049" TestUnit="mm" Status="NonProcessed" TestId="131"/>
<Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.4972" TestUnit="mm" Status="NonProcessed" TestId="132"/>
<Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.4960" TestUnit="mm" Status="NonProcessed" TestId="133"/>
<Tests DocStsMsg="0" EquipmentCode="CHIGMA1" TesterLogin="dpkrueger" Value="0.4996" TestUnit="mm" Status="NonProcessed" TestId="134"/>
</Coil>
Can you please guide me how to do it in a single query?
Thanks in advance.
Hi Odie,
Thanks for the quick offer.Sure,No problem.I expect the format to be as follows
<Coil xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="www.tempel.com/COIL.xsd">
<CoilId>97239</CoilId>
<CoilNo>777078</CoilNo>
<CoilPOOperatingUnit>TSUSA</CoilPOOperatingUnit>
<CoilPONo>3407</CoilPONo>
<MillNo>31</MillNo>
<MillCoilStatus>Test</MillCoilStatus>
<ItemNo>0140SP150 C5A</ItemNo>
<Weight>17365</Weight>
<UOM>POUNDS</UOM>
<DocumentNo>0</DocumentNo>
<DocumentDate>2008-10-13</DocumentDate>
<DocumentStatus>Processed</DocumentStatus>
<DocumentType>Tests</DocumentType>
<DocumentSource>MILL</DocumentSource>
<Tests EquipmentCode="MILLEDI" TesterLogin="MILLEDI" Value="84" TestUnit="15T" Status="Processed" TestId="65"></Tests>
<Tests EquipmentCode="MILLEDI" TesterLogin="MILLEDI" Value="1.39" TestUnit="W/Lb" Status="Processed" TestId="48"></Tests>
<Tests EquipmentCode="MILLEDI" TesterLogin="MILLEDI" Value="1979" TestUnit="W/Lb" Status="Processed" TestId="49"></Tests>
</Coil>
But instead it came with below format
<Coil xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSch
emaLocation="www.tempel.com/COIL.xsd"><CoilId>97239</CoilId><CoilNo>777078</Co
ilNo><CoilPOOperatingUnit>TSUSA</CoilPOOperatingUnit><CoilPONo>3407</CoilPONo>
<MillNo>31</MillNo><MillCoilStatus>Test</MillCoilStatus><ItemNo>0140SP150 C5A<
/ItemNo><Weight>17365</Weight><UOM>POUNDS</UOM><DocumentNo>0</DocumentNo><Docu
mentDate>2008-10-13</DocumentDate><DocumentStatus>Processed</DocumentStatus><Do
cumentType>Tests</DocumentType><DocumentSource>MILL</DocumentSource><Tests Equ
ipmentCode="MILLEDI" TesterLogin="MILLEDI" Value="84" TestUnit="15T" Status="P
rocessed" TestId="65"></Tests><Tests EquipmentCode="MILLEDI" TesterLogin="MILL
EDI" Value="1.39" TestUnit="W/Lb" St atus="Processed" TestId="48"></Tests><Tes
ts EquipmentCode="MILLEDI" TesterLog in="MILLEDI" Value="1979" TestUnit="W/Lb"
Status="Processed" TestId="49"></Tests></Coil>
The sample insert records are as follows
insert into COIL (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, test_id, value, test_uom, test_status, tester_login, equipment_code, doc_sts_msg)
values (97239, '777078', 'USA', '3407', '31', 'Test', '0140SP150 C5A', 17365, 'POUNDS', '0', to_date('13-10-2008', 'dd-mm-yyyy'), 'Processed', 'Tests', 'MILL', 65, 84, '15T', 'Processed', 'MILLEDI', 'MILLEDI', null);
insert into COIL (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, test_id, value, test_uom, test_status, tester_login, equipment_code, doc_sts_msg)
values (97239, '777078', 'USA', '3407', '31', 'Test', '0140SP150 C5A', 17365, 'POUNDS', '0', to_date('13-10-2008', 'dd-mm-yyyy'), 'Processed', 'Tests', 'MILL', 48, 1.39, 'W/Lb', 'Processed', 'MILLEDI', 'MILLEDI', null);
insert into COIL (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, test_id, value, test_uom, test_status, tester_login, equipment_code, doc_sts_msg)
values (97239, '777078', 'USA', '3407', '31', 'Test', '0140SP150 C5A', 17365, 'POUNDS', '0', to_date('13-10-2008', 'dd-mm-yyyy'), 'Processed', 'Tests', 'MILL', 49, 1979, 'W/Lb', 'Processed', 'MILLEDI', 'MILLEDI', null);
commit;
Thanks in Advance.
Similar Messages
-
i used form2xml in oracle 10 g suit to convert forms 5 .fmb to .xml . using the command:
frmf2xml.bat OVERWRITE=YES myform.fmb
The forms contains arabic character set, but the xml file is generated with character "????????? " , and the xml file is unusable
what can i do to keep arabic characters in the generated xml files.
Edit:
I run form2xml on windows xp SP3 with arabic support (codepage =1256)
The xml file is generated as UTF-8I resolved the problem.
step1: search in the registry for every NLS_Lang key and modify its value to codepage 1256 using regedit
step2: in control panel-Region and Language , I modified language to be Arabic
Now every thing is good -
Validating generated XML file with DTD
Hello all,
my requirement is to test the XML file with its DTD.
we are creating an XML file, before writing it on the application server , we need to test it with its DTD.
i found one method set_validating in the interface if_ixml_parser , for validating XML file, but not getting an idea how to use it, like how to link the DTD to XML etc.
if i try to use the above method am getting the following error:
Unable to retrieve the external entity 'd:\dtdfile.dtd'.
where 'd:\dtdfile.dtd' is the path of the DTD file included in the Doctype of the XML file.
Please help me to solve this.
Thx in advance.Hello,
Did you find your answer ?
I know how to validate an XML file an internal DTD, but not an external one... If you know, can you pelase advice ?
If you didn't found yet, you need to use method get_reason() to get the description of the error.
best regards,
Gilles. -
Making file desin with elements and attributes implementation
hello
this is an FILE to IDOC
I have an xml file that need to be enter to the XI. the XML has attributes and elements.
I would like to know how can I make an element with some attributes and below there should be a subelement.
for example, in delivery there will be all the attributes, and I would like to make it an array so there will be below subelemnt in the name of carrier for example.
(if any one has other ways to implement this file feel free to suggest.)
- <delivery number="1234567890" shipment-type="Y014" shipping-point="1910" ifm-reference="125" status="final">
- <!-- status initial, change or final
-->
<carrier>123456</carrier>
- <!-- This will be the SAP vendor code
-->
<scheduled-departure>200810011000</scheduled-departure>
- <!-- Precalculated departure date and time format YYYYMMDDHH24MI
-->
<scheduled-arrival>200810031600</scheduled-arrival>
- <!-- Precalculated delivery date and time
-->
<actual-departure>200810011015</actual-departure>
- <!-- Actual departure reported by carrier
-->
<actual-arrival>200810031545</actual-arrival>
- <!-- Actual arrival reported by carrier
-->
</delivery>>>that what I thought, but after I do the attributes for the element, I dont have the option to write for the element sub-element.
I guess the current row that is selected would be an attribute thus the option insert subelement is disabled. Always select the element and insert either attribute or subelement to it.
Thanks
SaNv... -
How do I Ftp a XML file with out namespace attribute
Hi All,
How do I FTP an xml file that is validated against a schema on the ftp adapter with out the namespace attribute being added to the first and second element of the XML file.
For example the xml looks like this when I transfer the file.
<XML_Event xmlns="http://xmlns.oracle.com/PlannedEventSTORMRequestProcess/STORM">
<Event_Begin xmlns="">
<XML_File_Header>
<Originating_System>xxx</Originating_System>
<ID>387</ID>
</XML_File_Header>
</Event_Begin>
</XML_Event>
However I want it to be….
<XML_Event>
<Event_Begin>
<XML_File_Header>
<Originating_System>xxx</Originating_System>
<ID>387</ID>
</XML_File_Header>
</Event_Begin>
</XML_Event>
How do i achieve this using the ftp adapter.
CheersHere is an example that will try to reach the given size in steps of 4 in quality.
var saveFile = File(Folder.desktop + "/test");
var fileSize = 70;
try{
tmpFile = File(saveFile+".jpg");
for(var z =100;z>5;z -=4){
SaveForWeb(tmpFile,z);
var chkFile = File(saveFile+".jpg");
//$.writeln(tmpFile + " qual = " + z + " Size = " +(chkFile.length/1024).toFixed(2) + "k" );
if((chkFile.length/1024).toFixed(2) < (fileSize +1)) break;
tmpFile.remove();
if(!tmpFile.exists) SaveForWeb(tmpFile,5);
}catch(e){$.writeln(e + " - " + e.line);}
function SaveForWeb(saveFile,jpegQuality) {
var sfwOptions = new ExportOptionsSaveForWeb();
sfwOptions.format = SaveDocumentType.JPEG;
sfwOptions.includeProfile = false;
sfwOptions.interlaced = 0;
sfwOptions.optimized = true;
sfwOptions.quality = Number(jpegQuality);
activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions); -
Generating XML File with Table data...
Hi All,
Bear with me, with my Oracle XML knowledge,,,
we have Oracle 8i ( Relaease 3) as our database, and managegement want to have XML type of Text file, with respect to data in the Customer Table. Expected XML tags would be the Column Names of the Table.
Table has three columns,, Name, Address, Telephone.
So desired XML file looks like below:
<Name>John Hunter</Name><Address> City Road, London</Address><Telephone>1223223</Telephone>
If I deceided to do this task using PL/SQL, how could I start it,,,, All comments are welcome, this is the first time that I am going to generate this type of file ,,,Hi Chandana,
You can check out the DBMS_XMLQUERY package for this purpose. It provides XMLType functionality in Oracle 8i. You can access the documentation for the same at:
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_xmlque.htm#ARPLS066
If you happen to have access to Oracle 9i, then you can use XMLType Views provided with XML DB for your requirement.
Thanks
Shefali -
How to generate xml file with multiple nodes using sqlserver as database in SSIS..
Hi ,
I have to generate the xml file using multiple nodes by using ssis and database is sqlserver.
Can some one guide me on to perform this task using script task?
sudhaWhy not use T-SQL for generating XML? You can use FOR XML for that
http://visakhm.blogspot.in/2014/05/t-sql-tips-fun-with-for-xml-path.html
http://visakhm.blogspot.in/2013/12/generating-nested-xml-structures-with.html
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Editing a XML file with PHP and HTML or AS2
Hi webmates...
I have been looking for a good tutorial on managing an XML
file through Flash (AS2) or HTML and PHP... but all of what I have
found at the moment are very confusing and incomplete... the
examples actually do not work ok...
Would anyone mind on addressing me any good place where I can
find nice tutorials for this ? perhaps any example ? I wil really
appreciate it, My web is already reading the XML file to load
data... but I also need to create an application for editing this
XML... thanx in advance...I have no experience with any decompilers beyond possibly attempting to trial one once. The only one I have seen recommended is made by Sothink.
Here is a link to a page with a tool that has an interface you can use to determine various properties of an swf file, including the Actionscript version.
http://blog.sitedaniel.com/2009/11/swf-info-width-height-swf-version-actionscript-version- framerate/ -
Generation of Xml file with java output
Hi i m new to xml and java combination. I have a name value pair kind of output returning from java program. I want to generate the new xml file with the data. Could some one help me out in generating xml file with the data. Could anyone send me the java code that does this task.
Let me know which parser are you using currently for reading xml files so that i assist you. For now, you can refer to STAX Parser API under this link
http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP3.html -
How to validate the Xml File With Java
Hi,
Can pls tell me. I want to validate the XML File for the Some Mandartory TAG. if that if Tag null i want to generate error xml file with error and i want move another folder with java. pls help me as soon as possibleUse a validating parser (any recent Xerces, for one) and switch on the validation feature. Very much vendor-specific, so look at the docs of your parser. Oh, you do have a schema for these documents, don't you?
-
Create xml file with values from context
Hi experts!
I am trying to implement a WD application that will have some input fields, the value of those input fields will be used to create an xml file with a certain format and then sent to a certain application.
Apart from this i want to read an xml file back from the application and then fill some other context nodes with values from the xml file.
Is there any standard used code to do this??
If not how can i do this???
Thanx in advance!!!
P.S. Points will be rewarded to all usefull answers.
Edited by: Armin Reichert on Jun 30, 2008 6:12 PM
Please stop this P.S. nonsense!Hi,
you need to create three util class for that:-
XMLHandler
XMLParser
XMLBuilder
for example in my XML two tag item will be there e.g. Title and Organizer,and from ur WebDynpro view you need to pass value for the XML tag.
And u need to call buildXML()function of builder class to generate XML, in that i have passed bean object to get the values of tags. you need to set the value in bean from the view ui context.
Code for XMLBuilder:-
Created on Apr 4, 2006
Author-Anish
This class is to created for having function for to build XML
and to get EncodedXML
and to get formated date
package com.idb.events.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.idb.events.Event;
public class XMLBuilder {
This attribute represents the XML version
private static final double VERSION_NUMBER = 1.0;
This attribute represents the encoding
private static final String ENCODING_TYPE = "UTF-16";
/*Begin of Function to buildXML
return: String
input: Event
public String buildXML(Event event) {
StringBuffer xmlBuilder = new StringBuffer("<?xml version=\"");
xmlBuilder.append(VERSION_NUMBER);
xmlBuilder.append("\" encoding=\"");
xmlBuilder.append(ENCODING_TYPE);
xmlBuilder.append("\" ?>");
xmlBuilder.append("<event>");
xmlBuilder.append(getEncodedXML(event.getTitle(), "title"));
xmlBuilder.append(getEncodedXML(event.getOrganizer(), "organizer"));
xmlBuilder.append("</event>");
return xmlBuilder.toString();
/End of Function to buildXML/
/*Begin of Function to get EncodedXML
return: String
input: String,String
public String getEncodedXML(String xmlString, String tag) {
StringBuffer begin = new StringBuffer("");
if ((tag != null) || (!tag.equalsIgnoreCase("null"))) {
begin.append("<").append(tag).append(">");
begin.append("<![CDATA[");
begin.append(xmlString).append("]]>").append("</").append(
tag).append(
">");
return begin.toString();
/End of Function to get EncodedXML/
/*Begin of Function to get formated date
return: String
input: Date
private final String formatDate(Date inputDateStr) {
String date;
try {
SimpleDateFormat simpleDateFormat =
new SimpleDateFormat("yyyy-MM-dd");
date = simpleDateFormat.format(inputDateStr);
} catch (Exception e) {
return "";
return date;
/End of Function to get formated date/
Code for XMLParser:-
Created on Apr 12, 2006
Author-Anish
This is a parser class
package com.idb.events.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import com.idb.events.Event;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
public class XMLParser {
Enables namespace functionality in parser
private final boolean isNameSpaceAware = true;
Enables validation in parser
private final boolean isValidating = true;
The SAX parser used to parse the xml
private SAXParser parser;
The XML reader used by the SAX parser
private XMLReader reader;
This method creates the parser to parse the user details xml.
private void createParser()
throws SAXException, ParserConfigurationException {
// Create a JAXP SAXParserFactory and configure it
SAXParserFactory saxFactory = SAXParserFactory.newInstance();
saxFactory.setNamespaceAware(isNameSpaceAware);
saxFactory.setValidating(isValidating);
// Create a JAXP SAXParser
parser = saxFactory.newSAXParser();
// Get the encapsulated SAX XMLReader
reader = parser.getXMLReader();
// Set the ErrorHandler
This method is used to collect the user details.
public Event getEvent(
String newsXML,
XMLHandler xmlHandler,
IWDMessageManager mgr)
throws SAXException, ParserConfigurationException, IOException {
//create the parser, if not already done
if (parser == null) {
this.createParser();
//set the parser handler to extract the
reader.setErrorHandler(xmlHandler);
reader.setContentHandler(xmlHandler);
InputSource source =
new InputSource(new ByteArrayInputStream(newsXML.getBytes()));
reader.parse(source);
//return the results of the parse
return xmlHandler.getEvent(mgr);
Code for XMLHandler:-
Created on Apr 12, 2006
Author-Anish
This is a parser class
package com.idb.events.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import com.idb.events.Event;
Created on Apr 12, 2006
Author-Anish
*This handler class is created to have constant value for variables and function for get events,
character values for bean variable,
parsing thr date ......etc
package com.idb.events.util;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
import java.util.*;
import com.idb.events.Event;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
public class XMLHandler extends DefaultHandler {
private static final String TITLE = "title";
private static final String ORGANIZER = "organizer";
IWDMessageManager manager;
private Event events;
private String tagName;
public void setManager(IWDMessageManager mgr) {
manager = mgr;
This function is created to get events
public Event getEvent(IWDMessageManager mgr) {
manager = mgr;
return this.events;
This function is created to get character for setting values through event's bean setter method
public void characters(char[] charArray, int startVal, int length)
throws SAXException {
String tagValue = new String(charArray, startVal, length);
if (TITLE.equals(this.tagName)) {
this.events.setTitle(tagValue);
if (ORGANIZER.equals(this.tagName)) {
String orgName = tagValue;
try {
orgName = getOrgName(orgName);
} catch (Exception ex) {
this.events.setOrganizer(orgName);
This function is created to parse boolean.
private final boolean parseBoolean(String inputBooleanStr) {
boolean b;
if (inputBooleanStr.equals("true")) {
b = true;
} else {
b = false;
return b;
This function is used to call the super constructor.
public void endElement(String uri, String localName, String qName)
throws SAXException {
super.endElement(uri, localName, qName);
/* (non-Javadoc)
@see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
This function is used to call the super constructor.
public void fatalError(SAXParseException e) throws SAXException {
super.fatalError(e);
This function is created to set the elements base on the tag name.
public void startElement(
String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException {
this.tagName = localName;
if (ROOT.equals(tagName)) {
this.events = new Event();
public static void main(String a[]) {
String cntry = "Nigeria";
XMLHandler xml = new XMLHandler();
ArrayList engList = new ArrayList();
engList = xml.getCountries();
ArrayList arList = xml.getArabicCountries();
int engIndex = engList.indexOf(cntry);
System.out.println("engIndex :: " + engIndex);
String arCntryName = (String) arList.get(engIndex);
System.out.println(
">>>>>>>>>>>>>>>>>>>>" + xml.getArabicCountryName(cntry));
Hope that may help you.
If need any help , you are most welcome.
Regards,
Deepak -
Loading XML file with missing elements dynamically through ODI
Hi Guys ,
I have the below xml file with two nodes Employee and Address. On a daily basis , sometimes the address element might not come in from the source xml file , but my interface has columns mapped to address elements, and hence it can fail due to the source element not being found in the file or data might not get loaded due to the 'and' condition in the sql query generated between the employee and address elements. Is there a way where i can load the data dynamically where i can search in the file only for the elements (Employee) present and load data only for those elements dynamically?
XML File:
<?xml version="1.0" encoding="UTF-8" ?>
<EMP>
<Empsch>
<Employee>
<EmployeeID>12345</EmployeeID>
<Initials>t</Initials>
<LastName>john</LastName>
<FirstName>doe</FirstName>
</Employee>
<Address>
<WorkPhone>12345</WorkPhone>
<WorkAddress>Test 234</WorkAddress>
</Address>
</Empsch>
</EMP>
Thanks ,
Revanth TambisettyI was able to resolve it by using left outer joins and referring the table structure from the XSD
-
Make a sort with ODI while generating XML File
Hi all,
I made a package whith several interfaces and a treatment.
Each interface targets a table in my XML schema and the final treatment is a CreateXMLFile.
Everything goes well, my XML file is generated :D
Now I'd like to make a sort in an XML element. I know how to order the elements between them but can't find a way to sort a specific element. Excuse my poor english, I'm not really clear...
My XML is built like this :
<root>
<questions>
<question>
<questionnumber>1</questionnumber>
</question>
<question>
<questionnumber>2</questionnumber>
</question>
<questions>
<root>
So my problem is to make the questionnumber ordered.
I tried to modify the IKM SQL Incremental Update to add a ORDER BY in the "Insert new rows" step.
The generated code is executed with success... but in the end, my XML file is not sorted :S
So first question, do you have an idea to be able to view the data in my XML schema tables ? This schema is stored in the memory engine and not in an external base. I ask that because when you try to execute the query "select * from XMLSchema.XMLTable" in the Operator, it appears you get the datas you had when the schema had been reversed. Idem when you try to view the datas in datastore. So first of all I'd like to do this control to be sure my order by is taken into account.
Second question, do you know how the Odi XML driver builds the XML File with the command CreateXMLFile, because I think that my XML table is well sorted but that the CreateXMLFile doesn't repect this order. I checked the driver tutorial but couldn't find any help on that subject.
So if anyone has got an idea to help me, I would appreciate a lot.
Thanks,
ThierryStill searching but without success
-
Generate XML file from RFC using Web Services
Hi,
I am trying to save an RFC enabled Function Module output to an XML file using ABAP web services.
I could able to create Web Service and release it using WSCONFIG/WSADMIN. I can actually get the output in XML file when i launch the web service home page. But I need this to be done in the ABAP program itself. So If i run the RFC I could able to create,release web service and capture the Generated XML file by SOAP runtime.
Any FM available?
Thanks,
Ram Sanjeevwhich version of WAS you are on .
if you are on WAS6.40 check the following weblog on how to consume webservice using the wsdl file.
/people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap
lower version of WAS use class cl_http_client.
if this case you have to manually build the soap message.
/people/durairaj.athavanraja/blog/2004/09/20/consuming-web-service-from-abap
Regards
Raja -
Generating XML file from WORD file
hello
Everyboby.
I am trying to generate xml file from a word file.
but i am stucked with how to do it? any kind of help will be useful.
i think for doing this work i have to develop XSD file, because when i am creating the xml file, the hidden space within the word file is not catched.
please help me out.
waiting for reply
thanks
milindhello
after searching on the net i came to know that org.apache.poi.hwpf.* is used for reading word file and its contents. for converting it to xml i have to use org.exolab.castor.xml.*
now my problem is that POI is in its early beta version and there is no help or any sample examples for understanding the api.
so if you have any idea regarding it, please write to me.
waiting for your reply.
thanks
Milind
Maybe you are looking for
-
How do you calculate multiple fields in a Form?
Hi, I have a spreadsheet with several headings and several fields as illustrated below, and description of each field and calculation required is listed below. Rate Per Day Days Course Attending Total $1,000 2 Course A Yes $2,000 $2,000 1 Course B Ye
-
Enhancement requests do seem to be worthwhile in the end...
Having requested the continuous/shuffle music video playback several times in the last 18 months or so, and urged people to do so via... http://www.apple.com/feedback/appletv.html ...it has finally been implemented and I'm chuffed to bits. Well done
-
Help me choose a monetization model
I am creating a Windows Phone application(category - tools and productivity). I now choose monetization model: 1. I will show ads in the application. The user can buy off advertising. It will be the same application package. Check payment will occur
-
Can anyone help? I upgraded my iPad to 5.1 sent my apps to iTunes I see the apps but can restore them I don't see restore anywhere HELP thanks to all who canhelp
-
My wife and I want to consolidate our music libraries on our travel laptop.
It would also be nice to have all music on a dedicated drive. Is this possible? Thanks. M&K