Extracting and Loading XML document
We need to extract and load an XML document into the database
For e.g.
<ROW> <EMP_ID>1</EMP_ID> <EMP_NAME>SSK</EMP_NAME>
<RESUME> Resume of sssk
</RESUME>
</ROW>
We need to load emp_id, emp_name to emp_id, emp_name field in the database and <RESUME> field to a CLOB.
The table is as follows
EMP_ID NUMBER
EMP_NAME VARCHAR2(100)
RESUME CLOB
How exactly is this done using the XSU utility? Does it support loading of <RESUME> data in this case to a CLOB.
Where could I find examples of doing this.
null
The "first child" of most of your elements is a white-space node containing a newline character. Your code incorrectly assumes it is an element node.
Similar Messages
-
Creating new analysis gives "Error loading XML Document from ..."
Trying to create analysis and getting "Error loading XML Document from saw.dll/answers/answersproperties.xml?fmapId=S1clug.
The response given was:" after choosing subject area. Analysis editor is opened but Subject Areas is empty and can't do anything.
The problem is on Mozilla 12 (16.0.2, 17.0.1) and IE 8. Chrome works fine.
My system is Win 7, BI 11.1.1.6.0 is on Oracle Linux (and by the way Mozilla from Linux system works fine)
What could be the reason of this?
Edited by: 898973 on 4/12/2012 15:11Reinstalling Mozilla with "Remove personal data" option checked resolved the problem.
-
I tested my procedure for upgrading from OBI 11.1.1.5 to 11.1.1.6 which was successful. I had to rollback to OBI 11.1.1.5 using my database backup and VM snapshot due to project requirements.
The OBI application successfully comes up but users who login just get "Error loading XML Document from /analytics/saw.dll/common/privileges.xml?fmapID=KqIJCw. The response given was: ". They can't close this message box so are unable to do anything.
How can I fix this?Hi All,
You can face this issue with other versions of OBIEE 11.*
Problem cab be solved as follows:
Go to http://localhost:7001/em > coreapplication > Capacity Management > Scalibility >
1. Lock and edit
2 .increase number of presentation services to 2
3. restart opmn component.
Go to coreapplication > Availibility > processes
1 .please note that in deployment > catalog > change path of catalog field from $coreapplication to path where your catalog resides.
2. Take down your primary instance.
3. As your secondary is up, it will grant you to browse you through catalog and dashboards.
If you want to run primary instance of presentation services
Go to path \Middleware\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips2
except catalog and catalog manager > Copy all other files to coreapplication_obips1
restart opmn component > problem solved.!!!
Regards,
Akshay S.
please like if you find it helpful -
Hi ,
I am trying to load XML document in a Dw .Is it possible to do in OWB ?
if Yes .Can someone please help me .
Thanks,
katetAs far as my understanding goes, there is no native mechanism avialble in OWB to handle XML sources.
The only possible way I see to handle this would be :
-through PL/SQL and table function. Or may be writting Java stored proceduers.
I stumble upon this very good posting at Asktom which talks about handling XML with SQL.
http://asktom.oracle.com/pls/ask/f?p=4950%3A8%3A773383103134756029%3A%3ANO%3A%3AF4950_P8_DISPLAYID%2CF4950_P8_CRITERIA%3A4061080732051%2C -
I'm try to load xml document from CLOB in following way:
--- procedure loadXML.sql -----
CREATE OR REPLACE PROCEDURE loadXML
IS
CONTENT CLOB := ' ';
SOURCE bfile := BFILENAME('XMLFILES', 'N_95_A.xml');
begin
DBMS_LOB.OPEN(SOURCE, DBMS_LOB.LOB_READONLY);
DBMS_LOB.loadFromFile(CONTENT, SOURCE, DBMS_LOB.getLength(SOURCE));
DBMS_LOB.fileClose(SOURCE);
insert into OFERTY (OFDOCUMENT)
values (sys.XMLtype.createXML(CONTENT));
commit;
end;
and I get
SQL> @e:\myxml\loadXML
declare
ERROR at line 1:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of '<'
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at line 1
ORA-06512: at line 8
What is wrong?Have you tried simply outputting iusing the htp.p function? for example:
/* ... inside a PL/SQL region */
declare
lclb_output clob;
begin
select doc_xml into lclb_output from mf_xml_docs where doc_id = :P1_DOC_ID;
htp.p(lclb_output); -- you may have to split this into chunks and loop through, depending on how big the clob is
end; -
How to extract the actual XML document from soap message?
My problem is " how to extract the actual XML document from soap message? "
i just want to extract the attachment i.e. (pure XML document without any soap header or envolope).
i could be ver thank full if u could solve my problem.
[email protected]Hi,
This is some skeleton code for extracting an attachment from a SOAPMessage.
import javax.activation.DataHandler.;
import javax.xml.soap.*;
import javax.xml.message.*;
Iterator allAttachments = message.getAttachments();
AttachmentPart ap1 = null;
while(allAttachments.hasNext()){
ap1 = (AttachmentPart)allAttachments.next();
//Check that the attachment is correct one. By looking at its mime headers
//Convert the attachment part into its DOM representation:
if(ap1.getContentType() == "text/xml"){
//Use the activation dataHandler class to extract the content, then create a StreamSource from
//the content.
DataHandler attachmentContent = ap1.getDataHandler();
StreamSource attachmentStream = new StreamSource(attachmentContent.getInputStream());
DOMResult domAttachment = getDOMResult(attachmentStream);
domAttachment holds an xml representation of the attachment.
Hope this helps. -
I know Safari 1.3 does not support loading of an XML Document, but does Safari 2 or 3 support the XML DOM? I will be really really really disappointed in apple if they still do not support the XML DOM for parsing with javascript. Why is Apple so negligent to Javascript?
My XML doc loads fine in IE 5.5+ and FF1+ but I cannot get Safari clients to load the document. This is extremely detrimental to my site considering over 20% of the users are safari clients. I absolutely need this XML doc to be available to them.
What is the safari specific javascript needed to load an XML document?
Any help is GREATLY appreciated
Mac OS X (10.4.8)Why does no one know the answer to this question? I've posted in every forum I could find.
This procedure should be very standard and very easy. Much like it is in IE/FF. Why does no one know how to do it for Safari? -
Extracting Values from XML-Document in pl/sql
Hello!
I need to extract the content of the following extract:
<ns1:OXERPGetArticlesResponse xmlns:ns1="OXERPService">
<ns1:OXERPGetArticlesResult>
<ns1:OXERPType>
<ns1:aResult>
<ns1:ArrayOfString>
<ns1:string>OXID</ns1:string>
<ns1:string>531f91d4ab8bfb24c4d04e473d246d0b</ns1:string>
</ns1:ArrayOfString>
<ns1:ArrayOfString>
<ns1:string>OXARTNUM</ns1:string>
<ns1:string>0601-85-069</ns1:string>
</ns1:ArrayOfString>
<ns1:ArrayOfString>
<ns1:string>OXPRICE</ns1:string>
<ns1:string>100.5</ns1:string>
</ns1:ArrayOfString>
</ns1:aResult>
<ns1:blResult>true</ns1:blResult>
<ns1:sMessage/>
</ns1:OXERPType>
<ns1:OXERPType>
<ns1:aResult>
<ns1:ArrayOfString>
<ns1:string>OXID</ns1:string>
<ns1:string>531a8af7d9a9a5bb53b65a2b9a5356e5</ns1:string>
</ns1:ArrayOfString>
<ns1:ArrayOfString>
<ns1:string>OXARTNUM</ns1:string>
<ns1:string>0601-85-069-1</ns1:string>
</ns1:ArrayOfString>
<ns1:ArrayOfString>
<ns1:string>OXPRICE</ns1:string>
<ns1:string>89.9</ns1:string>
</ns1:ArrayOfString>
</ns1:aResult>
<ns1:blResult>true</ns1:blResult>
<ns1:sMessage/>
</ns1:OXERPType>
</ns1:OXERPGetArticlesResult>
</ns1:OXERPGetArticlesResponse>
The output should be:
OXID OXARTNUM OXPRICE
531f91d4ab8bfb24c4d04e473d246d0b 0601-85-069 100.5
531a8af7d9a9a5bb53b65a2b9a5356e5 0601-85-069-1 89.9
The count of rows and columns is variable.
I want to do this by using xmltype.extract but I found no way to create a loop over the content of the xml document.
Hopefully someone can help me!
Regards
HerbertOK, then you should be able to use something like :
SQL> var xmldoc clob;
SQL> begin
2 :xmldoc := '<ns1:OXERPGetArticlesResponse xmlns:ns1="OXERPService">
3 <ns1:OXERPGetArticlesResult>
4 <ns1:OXERPType>
5 <ns1:aResult>
6 <ns1:ArrayOfString>
7 <ns1:string>OXID</ns1:string>
8 <ns1:string>531f91d4ab8bfb24c4d04e473d246d0b</ns1:string>
9 </ns1:ArrayOfString>
10 <ns1:ArrayOfString>
11 <ns1:string>OXARTNUM</ns1:string>
12 <ns1:string>0601-85-069</ns1:string>
13 </ns1:ArrayOfString>
14 <ns1:ArrayOfString>
15 <ns1:string>OXPRICE</ns1:string>
16 <ns1:string>100.5</ns1:string>
17 </ns1:ArrayOfString>
18 </ns1:aResult>
19 <ns1:blResult>true</ns1:blResult>
20 <ns1:sMessage/>
21 </ns1:OXERPType>
22 <ns1:OXERPType>
23 <ns1:aResult>
24 <ns1:ArrayOfString>
25 <ns1:string>OXID</ns1:string>
26 <ns1:string>531a8af7d9a9a5bb53b65a2b9a5356e5</ns1:string>
27 </ns1:ArrayOfString>
28 <ns1:ArrayOfString>
29 <ns1:string>OXARTNUM</ns1:string>
30 <ns1:string>0601-85-069-1</ns1:string>
31 </ns1:ArrayOfString>
32 <ns1:ArrayOfString>
33 <ns1:string>OXPRICE</ns1:string>
34 <ns1:string>89.9</ns1:string>
35 </ns1:ArrayOfString>
36 </ns1:aResult>
37 <ns1:blResult>true</ns1:blResult>
38 <ns1:sMessage/>
39 </ns1:OXERPType>
40 </ns1:OXERPGetArticlesResult>
41 </ns1:OXERPGetArticlesResponse>';
42 end;
43 /
Procédure PL/SQL terminée avec succès.
SQL> SELECT x1.rec_id
2 , x2.col_name
3 , x2.col_value
4 FROM XMLTable(
5 XMLNamespaces('OXERPService' as "ns1"),
6 '/ns1:OXERPGetArticlesResponse/ns1:OXERPGetArticlesResult/ns1:OXERPType/ns1:aResult'
7 passing xmltype(:xmldoc)
8 columns rec_id for ordinality
9 , rec_xml xmltype path 'ns1:ArrayOfString'
10 ) x1,
11 XMLTable(
12 XMLNamespaces('OXERPService' as "ns1"),'/ns1:ArrayOfString'
13 passing x1.rec_xml
14 columns col_name varchar2(30) path 'ns1:string[1]'
15 , col_value varchar2(30) path 'ns1:string[2]'
16 ) x2
17 ;
REC_ID COL_NAME COL_VALUE
1 OXID 531f91d4ab8bfb24c4d04e473d246d
1 OXARTNUM 0601-85-069
1 OXPRICE 100.5
2 OXID 531a8af7d9a9a5bb53b65a2b9a5356
2 OXARTNUM 0601-85-069-1
2 OXPRICE 89.9
6 ligne(s) sélectionnée(s).You mentioned that the number of column(s) is not known in advance. That's gonna be a problem to present the data column-wise.
Version 11g has the PIVOT feature, but still you have to know how many columns there will be in the result set.
How are you going to use the data after extraction?
Maybe we could advise some other techniques more relevant for your requirement. -
Loading XML Document into Structured Storage
HI Everybody,
I am confronted with a BUG in Oracle which is being fixed but will last a long time. I have a relatively complex Schema with manifold includes, imports and inheritances which I can register successfully. The object-relational table is also generated. But loading the instance document with INSERT INTO... fails due to severe internal error. I have not yet tried SQL*Loader, however.
Please, does anyone know a safe alternative method to parse and load? Structured storage is mandatory because I need to retrieve individual elements and attributes. Instance documents are big, ca. 20 MB.
Thanks, regards
Miklos HERBOLYHI,
Oracle version is 11.1.0.7.0.
Metalink found three bugs related to the error ORA-00600: Interner Fehlercode, Argumente: [qmxConvUnkType], [], [], [], [],
The bugs are:
BUG 8644684 ORA-600 [QMXCONVUNKTYPE] DURING INSERT INTO SCHEMA-BASED TABLE
BUG 8671408 INSERT OF XML DOC INTO AN XML SCHEMA STORED AS BINARY XML FAILS WITH ORA-30937
BUG 8683472 SCHEMA EXECUTABLE RETURNS INCORRECT ERRORS DURING VALIDATION AGAINST XML SCHEMA
Well, I have to look round in XML DB Forum yet. -
Parse and output XML document while preserving attribute order
QUESTION: How can I take in an element with attributes from an XML and output the same element and attributes while preserving the order of those attributes?
The following code will parse and XML document and generate (practically) unchanged output. However, all attributes are ordered a-z
Example: The following element
<work_item_type work_item_db_site="0000000000000000" work_item_db_id="0" work_item_type_code="3" user_tag_ident="Step" name="Work Step" gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_site="0000000000000000" last_upd_db_id="0" rstat_type_code="1">
</work_item_type>is output as:
<work_item_type gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_id="0" last_upd_db_site="0000000000000000" name="Work Step" rstat_type_code="1" user_tag_ident="Step" work_item_db_id="0" work_item_db_site="0000000000000000" work_item_type_code="3">
</work_item_type>As you may notice, there is no difference in these besides order of the attributes!
I am convened that the problem is not in the stylesheet.xslt but if you are not then it is posted bellow.
Please, someone help me out with this! I have a feeling the solution is simple
The following take the XML from source.xml and outputs it to DEST_filename with attributes in a-z order
Code:
private void OutputFile(String DEST_filename, String style_filename){
//StreamSource stylesheet = new StreamSource(style_filename);
try{
File dest_file = new File(DEST_filename);
if(!dest_file.exists())
dest_file.createNewFile();
TransformerFactory tranFactory = TransformerFactory.newInstance();
Transformer aTransformer = tranFactory.newTransformer();
aTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
Source src = new DOMSource("source.xml");
Result dest = new StreamResult(dest_file);
aTransformer.transform(src, dest);
System.out.println("Finished");
catch(Exception e){
System.err.print(e);
System.exit(-1);
}You can't. The reason is, the XML Recommendation explicitly says the order of attributes is not significant. Therefore conforming XML serializers won't treat it as if it were significant.
If you have an environment where you think that the order of attributes is significant, your first step should be to reconsider. Possibly it isn't really significant and you are over-reaching in some way. Or possibly someone writing requirements is ignorant of this fact and the requirement can be discarded.
Or possibly your output is being given to somebody else who has a defective parser which expects the attributes to be in a particular order. You could quote the XML Recommendation to those people but often XML bozos are resistant to change. If you're stuck writing for that parser then you'll have to apply some non-XML processing to your output to fix it up on their behalf. -
Loading XML document for DOM parsing
Can anyone suggest other API's to load a XML document into memory so they can be parsed using the DOM with Java?(e.g. The "load(url)" interface method specific to IE5)
ThanksCheck out the DOMSample.java code came with the XML Parser for Java v2 download.
Oracle XML Team -
Difference between SDO and a xml document
Hello,
I want to know what is the exact difference between a SDO and XML document.According to my understanding, SDO defines a Java binding framework of its own. XML is a kind of data being bound to SDO.
SDO can be represented as XML.
But what is the difference between a normal XML document and a XML representing a SDO ?
How can we say by looking at a XML doc that it is a representation of a SDO and not JUST ANY xml doc?
Please clarify.
Thanks
NutanLet's see.
Facelets creates a facelets page
JSP creates a JSP page
{noformat}:){noformat}
Facelets is the "official" view language for JSF 2.0
http://www.realdevelopers.com/blog/development/facelets-vs-jsp should give you some more insight as well.
John -
Xpath and Get XML Document Data
Good Morning,
I have just recently gotten involved in a project that requires communicating with some web services (axis2). We have existing scripts that handle this already, but they were built when we weren't on axis2 so now the XML output from the web service call is slightly different and i am no longer able to use the same xpath statement in the Get XML Document Data step.
I am receiving either null values or a prefix namespace error. I am new to xpath and have been reading as best i can from http://www.w3schools.com/xpath/ to try and understand how to write my statements to pull out the data i want correctly.
I have read that sometimes the editor has problems if the XML contains namespace declarations, etc.
Below is an example XML output where I'd like to be able to read the value in the ax211:success. My xpath gets prefix namespace errors as it doesn't recognize ax211.
Xpath: /descendant::ns:validateCertificationResponse/child::ns:return/child::ax211:success
Perhaps my xpath statement is just incorrect and wouldn't retrieve what i expect it to....
Any advice is appreciated.
Thanks,
KevinHi,
well, it appears that text() is automatically appended to the XPath query for some reason in UCCX, this is why you actually see the text node within the ax211:success element. This //*[local-name()="success"] select the whole node, not its first child (which is actually the first element, which also happens to be a text).
Anyway,
// - anywhere
* - any node
And within this "everything" you actually search with the condition within the angular brackets.
G. -
Loading XML Document from JFileChooser
My initial version of this app I hardcoded the XML filename. Now, I would like to load an xml file via a JFileChooser. The problem I'm having is that I create the DOM Document in the constructor because of dependencies on the JTree. Well, I don't call showDialog until the "open" action is called which is further into the program. By then it's too late. Here is the code. I extracted some unecessary code for reading purposes.
public class DomGui extends JPanel implements DomGuiConstants, ActionListener
private JScrollPane treeView;
private String xmlFilename;
private Document document;
private JFileChooser fileChooser;
private ExtensionFilter fileFilter;
private static JFrame frame;
private static JTree jtree;
public DomGui() throws Exception
frame = new JFrame(DOM_VIEWER);
fileChooser = new JFileChooser();
fileFilter = new ExtensionFilter(XML_EXTENSION, XML_DESCRIPTION);
// Create the Document
//xmlFilename = "W:/RoseModel/ImplementationView/seng/ewcs/clwc/Simulation/Utilities/Xml/DomViewer/TVschedule.xml";
try
CreateDomDocument createDomDocument = new CreateDomDocument(xmlFilename);
document = createDomDocument.getDocument();
catch (FileNotFoundException fnfe)
System.out.println(fnfe);
System.exit(1);
// Create a Tree Model
DomTreeModel model = new DomTreeModel(document);
// Create a renderer
DomTreeCellRenderer treeCellRenderer = new DomTreeCellRenderer();
// Create the JTree
jtree = new JTree(model);
// Create an Editor
DomTreeCellEditor treeCellEditor = new DomTreeCellEditor(jtree);
// Build left-side view
// an empty tree and put it a JScrollPane so users can see
// its contents as it gets large
treeView = new JScrollPane(jtree);
treeView.getViewport().add(jtree);
treeView.setPreferredSize(new Dimension( leftWidth, windowHeight ));
// Create a JSplitPane to hold the left side JTree
// and the right side JEditorPane
// Build split-pane view
splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT,
treeView,
htmlView );
splitPane.setContinuousLayout( true );
splitPane.setDividerLocation( leftWidth );
splitPane.setPreferredSize(new Dimension
( windowWidth + 10, windowHeight+10 ));
// Add GUI components
this.setLayout(new BorderLayout());
this.add("Center", splitPane );
public static void makeFrame()
int FRAME_WIDTH = 670;
int FRAME_HEIGHT = 600;
// Set up the tree, the views, and display it all
try
final DomGui guiPanel = new DomGui();
frame.getContentPane().add("Center", guiPanel );
catch (Throwable throwable)
throwable.printStackTrace();
System.exit(1);
public void actionPerformed(ActionEvent actionEvent)
String actionCommand = actionEvent.getActionCommand();
System.out.println("Action: " + actionCommand);
if (actionCommand.equalsIgnoreCase("Quit"))
System.exit(0);
else if (actionCommand.equalsIgnoreCase("Open"))
showDialog("Open XML File",
"Open",
"Open the file",
'o',
null);
// end actionPerformed
public File showDialog (String dialogTitle,
String approveButtonText,
String approveButtonToolTip,
char approveButtonMnemonic,
File file)
fileChooser.setDialogTitle(dialogTitle);
fileChooser.setApproveButtonText(approveButtonText);
fileChooser.setApproveButtonToolTipText(approveButtonToolTip);
fileChooser.setApproveButtonMnemonic(approveButtonMnemonic);
fileChooser.setFileSelectionMode(fileChooser.FILES_ONLY);
fileChooser.rescanCurrentDirectory();
fileChooser.setSelectedFile(file);
fileChooser.addChoosableFileFilter(fileFilter);
fileChooser.setFileFilter(fileFilter);
int result = fileChooser.showDialog(this, null);
System.out.println("Result is: " +result);
if (result == fileChooser.APPROVE_OPTION)
System.out.println("I'm Here 1");
System.out.println("File selected: " + fileChooser.getSelectedFile());
xmlFilename = fileChooser.getSelectedFile().toString();
return fileChooser.getSelectedFile();
else
System.out.println("I'm Here 2");
return null;
// end showDialog
[\code]In your actionPerformed() method, shouldn't you do something with the File returned by showDialog()? For instance:
else if (actionCommand.equalsIgnoreCase("Open"))
xmlFilename = showDialog("Open XML File",
"Open",
"Open the file",
'o',
null).getName();
}Because it seems that, for now at least, you're choosing a file and then just kinda throwing it away... -
FSG schema and load xml data fails
I want to start using xml publisher to make the FSG reports look better. Whilst Oracle provides a basic template, it doesn't allow very much control over the data.
How do I create a xml data file and schema so that I can create a new rtf template.
I tried loading the xml output of the FSG request but Word complained that "Invalid at top level of document Source authentication failed"Just found Note:297280.1 on Metalink where there is a template that can be downloaded that has all the FSG columns seperate allowing
Reorder how the columns are displayed.
· Add additional columns to display in your published report.
· Add background colors to the individual column headers or data regions.
· Change the font characteristics of each individual column.
Maybe you are looking for
-
How to pass parameter in query string
Hi Friends, I have a working struts app with Action classes and Servlets...now I need to pass query paramter to one of the servlets,can someone please tell me how to do that.I tried to put this code in web.xml but failed: <servlet> <servlet-name> tes
-
SAP Best Practices for Chemicals DE roadmap
Hi All, we are going to start a project using SAP Best Practices for Chemicals. We have decided to use DE version because the landscape is european based. I have seen on SAP Portal that the DE version is based on Ehp3: does anybody know if Ehp5 versi
-
hi could you please run this script: set myindi=createobject("InDesign.Application") set mydoc=myindi.activedocument for a=1 to 10 set myLine = mydoc.pages.item(1).graphiclines.add myline.geometricbounds = array(0,50,200,a*10) next (I think c
-
Hey all, I have a 250 Gig HD in my IntelliMAC. I also have a LaCie 500 Gig Firewaire drive hooked up. I can't figure out how to tell GB to use the firewire drive as my primary storage drive.... can this be done? it is automatically saving to my deskt
-
Query parameters / page navigation
Hi, I have a problem which i don't know how to solve with JSF. Is it somehow possible to have a action which reacts on the first request to a page (like it is with struts actions). Here is my example: I have two JSF pages. The first page (search.jsp)