XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
samir sawantSubject: XMLDOM not outputting the file
Author: samir sawant
Date: 23 Feb 2005 12:08 AM
Hi I am using following simple pl/sql using xmldom

But i am not able to get the output though procedure runs succesfully.
I am using oracle 9.2.0.4

DECLARE
doc xmldom.DOMDocument;
main_node xmldom.DOMNode;
root_node xmldom.DOMNode;
user_node xmldom.DOMNode;
item_node xmldom.DOMNode;
root_elmt xmldom.DOMElement;
item_elmt xmldom.DOMElement;
item_text xmldom.DOMText;
CURSOR get_users IS
SELECT *
FROM employees;
BEGIN
doc := xmldom.newDOMDocument;
main_node := xmldom.makeNode(doc);
root_elmt := xmldom.createElement(
doc
, 'EMPSET'
);
root_node := xmldom.appendChild(
main_node
, xmldom.makeNode(root_elmt)
);
FOR get_users_rec IN get_users LOOP
item_elmt := xmldom.createElement(
doc
, 'EMP'
);

user_node := xmldom.appendChild(
root_node
, xmldom.makeNode(item_elmt)
);
item_elmt := xmldom.createElement(
doc
, 'EMP_NO'
);
item_node := xmldom.appendChild(
user_node
, xmldom.makeNode(item_elmt)
);
item_text := xmldom.createTextNode(
doc
, get_users_rec.empno
);
item_node := xmldom.appendChild(
item_node
, xmldom.makeNode(item_text)
);
END LOOP;
xmldom.writeToFile(
doc
, 'd:\docSample.xml'
);
xmldom.freeDocument(doc);
end;
/


No file gets generated.

Thanks,

Samir

Postnext
Ivan PedruzziSubject: XMLDOM not outputting the file
Author: Ivan Pedruzzi
Date: 23 Feb 2005 12:22 AM
Samir,

I am not a PL/SQL expert but the equivalent in SQL/XML is

SELECT
XMLELEMENT(name "EMP",
XMLELEMENT(name "EMPNO",t.EMPNO)
)
FROM employees t

Hope this helps
Ivan

Postnext
samir sawantSubject: XMLDOM not outputting the file
Author: samir sawant
Date: 23 Feb 2005 09:18 AM
yeah.. Thanks..But I want it through PL/SQL as
I want to use a complex logic inside.
I just attach a simple code just for information.

The main thing is it's not giving me output in file
as XMLDOM.writetofile fails somewhere though it shows me
PL/Sql procedure run successfully.

Postnext
Ivan PedruzziSubject: XMLDOM not outputting the file
Author: Ivan Pedruzzi
Date: 23 Feb 2005 02:29 PM
Samir
I was able to create a procedure with your code then invoke it from stylus
As you know the proceduce is running on the server so the file will be generated there

Hope this helps
Ivan


Postnext
venu gopalSubject: XMLDOM not outputting the file
Author: venu gopal
Date: 04 Apr 2005 08:53 AM
Originally Posted: 04 Apr 2005 08:52 AM
Hi,<br> I am also having same problem.<br> as u said if it's creates in server. How to see that file thank u venu

Posttop
Ivan PedruzziSubject: XMLDOM not outputting the file
Author: Ivan Pedruzzi
Date: 04 Apr 2005 06:12 PM
In the example published the following command generates the output file
as d:\docSample.xml you need to browse the server and open the file like any other XML file

xmldom.writeToFile(doc, 'd:\docSample.xml');


 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.