XMLDOM package/ Plsql XML parser
HI, I'm trying to build XML document using plsql parser 1.0.2 using xmldom package.
The XML output given is not consistent and the AppendChild Call removed the Root node (from the XML document). This result in incomplete XML document.
-------Expected ouput format (though header is not properly displayed---------------
<Request>
<Requestor RequestorID="0100" RequestorType="SP"/>
<ValidateAddrReq IndividualRequestId="23456789">
<Address2
City="Manhattan" State="NY" Zip="10007">
<Addrnum Value="140"
AddrNumSuffix=""/>
<StreetName StreetN
ame="WEST" DirStreetPrefix="E" DirStreetSuffix="W" StreetTypeCode="ST"/>
</Address2>
</ValidateAddrReq>
</Request>
The same code is working in the Windows NT environment and when I moved to the actual AIX environment it is not working though, I'm not sure if there is any releation. Here the rood node and its child is chopped off.
And also the formatting is different.
-----------In AIX op. system, I'm getting ------------
<ValidateAddrReq IndividualRequestId="123123">
<Address2 City="BRONX"
State="NY">
<Addrnum Value="3040">
<StreetName
StreetName="BOSTON" StreetTypeCode="RD">
<Structure
StructType="BLDG" StructInfo="1A"/>
</StreetNam
e>
</Addrnum>
</Address2>
</ValidateAddrReq>
application Code:
null
I will look at using that, however in this example I dont belive that to be the problem as the string is < 4k.
Ive now got the error message, it was being handled as an exception before and not reporting the error message.
The error is
ORA-20100 Error Occured While Parsing unexpected EOF.
Any more suggestions
Regards
Similar Messages
-
PLSQL XML parser modified examples
Attachments: "1|type=application/octet-stream|desc=my personal domsample|file=domsample.sql|";"2|t
pe=text/xml|desc=garment xml file|file=Garment.xml|";"3|type=text/xml|desc=garment xml file|file=G
rment.xml|";"4|type=text/xml|desc=an xml file example|22661|file=Garment.xml|"
PLSQL XML parser modified examples
Hello Fine Folks at Oracle xml team
Here i am again from Copenhagen Denmark.
To day i would like to question/discuss the following things
ItFs all about the PL/SQL XML parser which i have installed on
my OracleServer 8i Enterprice
Question 1
If i want to modify DOMSAMPLE.sql or write my own program, i now
have very few choices
Where to look for intelligent answers to my questions.
1. My only source here is the package body for XMLPARSER which i
have installed under
the user SCOTT/TIGER. I made a dump of all that code to the
printer
So thats my xml
manual together with the domsample.sql
QUESTION . Where do i find programmers reference etc. etc. etc.
Question 2
2. Many of the *.xml examples here on my platform have a design
where elements have no attributes;
But still they are "placeholders" for elemt values.
Here is the DomSample source part iFam referring to
-- get all elements
nl := xmlparser.getElementsByTagName(doc, '*');
len1 := xmlparser.getLength(nl);
-- loop through elements
for j in 0..len1-1 loop
n := xmlparser.item(nl, j);
e := xmlparser.makeElement(n);
dbms_output.put_line(xmlparser.getTagName(e)Joergen Hoeyer (guest) wrote:
: PLSQL XML parser modified examples
: Hello Fine Folks at Oracle xml team
: Here i am again from Copenhagen Denmark.
: To day i would like to question/discuss the following things
: ItFs all about the PL/SQL XML parser which i have installed on
: my OracleServer 8i Enterprice
: Question 1
: If i want to modify DOMSAMPLE.sql or write my own program, i
now
: have very few choices
: Where to look for intelligent answers to my questions.
: 1. My only source here is the package body for XMLPARSER which
i
: have installed under
: the user SCOTT/TIGER. I made a dump of all that code to the
: printer
: So thats my xml
: manual together with the domsample.sql
: QUESTION . Where do i find programmers reference etc. etc. etc.
: Question 2
: 2. Many of the *.xml examples here on my platform have a
design
: where elements have no attributes;
: But still they are "placeholders" for elemt values.
: Here is the DomSample source part iFam referring to
: -- get all elements
: nl := xmlparser.getElementsByTagName(doc, '*');
: len1 := xmlparser.getLength(nl);
: -- loop through elements
: for j in 0..len1-1 loop
: n := xmlparser.item(nl, j);
: e := xmlparser.makeElement(n);
: dbms_output.put_line(xmlparser.getTagName(e) -
We are getting core dumps when using the plsql parser on our
data. The data files are about 500K.
We are on Oracle 8.1.5 on a Digital UNIX V4.0E.
Would you like to see the dumps or the trace files?
nullWe are having the same problem in OAS PLSQL cartridge
application using PLSQL XML parser. Core dumps are spontaneous
while the size of XML file is quite small (~20-50K). The trace
file has error messages like "Session exceeded soft sessionspace
limit of 0x100000 bytes" or "Address not mapped to object.
ORA-07445: exception encountered: core dump...". We are using OAS
4.0.8 and Oracle 8.1.5 for Solaris. OAS and DB Instance are on
the same box. But everything works fine when using OAS on
separate NT server.
Andrei Filimonov
Steve Coffman (guest) wrote:
: We are getting core dumps when using the plsql parser on our
: data. The data files are about 500K.
: We are on Oracle 8.1.5 on a Digital UNIX V4.0E.
: Would you like to see the dumps or the trace files?
null -
Question: Is this the proper way to parse an XML document that is contained within a clob?
procedure publishXmlClob
(p_xml_doc in clob
) is
v_parser xmlparser.parser;
v_doc xmldom.DOMDocument;
v_node_list xmldom.DOMNodeList;
v_list_len number := 0;
v_node xmldom.DOMNode;
v_xml_clob clob;
begin
dbms_lob.createTemporary(v_xml_clob, true, dbms_lob.session);
dbms_lob.copy(v_xml_clob, p_xml_doc, dbms_lob.getLength(p_xml_doc));
v_parser := xmlparser.newParser;
xmlparser.setValidationMode(v_parser, FALSE);
xmlparser.parseClob(v_parser, v_xml_doc);
v_doc := xmlparser.getDocument(v_parser);
end publishXmlClob;
Thanks for any help.
rQuestion: Is this the proper way to parse an XML document that is contained within a clob?
procedure publishXmlClob
(p_xml_doc in clob
) is
v_parser xmlparser.parser;
v_doc xmldom.DOMDocument;
v_node_list xmldom.DOMNodeList;
v_list_len number := 0;
v_node xmldom.DOMNode;
v_xml_clob clob;
begin
dbms_lob.createTemporary(v_xml_clob, true, dbms_lob.session);
dbms_lob.copy(v_xml_clob, p_xml_doc, dbms_lob.getLength(p_xml_doc));
v_parser := xmlparser.newParser;
xmlparser.setValidationMode(v_parser, FALSE);
xmlparser.parseClob(v_parser, v_xml_doc);
v_doc := xmlparser.getDocument(v_parser);
end publishXmlClob;
Thanks for any help.
r -
Importing packages for XMl parsing
In my Java program,statements to import org.w3c.dom, org.xml.sax, javax.xml.parsers, javax.ejb packages are not working.Can somebody tell me which jar files I should add in the classpath of my machine?
You need to retrieve the j2ee.jar file from sun.
http://java.sun.com/j2ee/1.4/download.html#sdk -
Hi All,
While accessing the JPDK provider URL that is integrated with PeopleSoft application, I am getting the following error
500 Internal Server Error
java.lang.NoClassDefFoundError at oracle.xml.parser.v2.NonValidatingParser.(NonValidatingParser.java:172) at oracle.xml.parser.v2.XMLParser.(XMLParser.java:174) at oracle.xml.parser.v2.DOMParser.(DOMParser.java:92) at oracle.portal.utils.xml.v2.XMLUtil.getParser(Unknown Source) at oracle.portal.utils.xml.v2.XMLUtil.parseDocument(Unknown Source) at oracle.portal.provider.v2.http.DefaultProviderLoader.parseRegistry(Unknown Source) at oracle.portal.provider.v2.http.DefaultProviderLoader.getProviderDefinition(Unknown Source) at oracle.portal.provider.v2.http.DefaultProviderLoader.validate(Unknown Source) at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.validate(Unknown Source) at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.showTestPage(Unknown Source) at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.handleHttp(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at oracle.webdb.provider.v2.adapter.SOAPServlet.doHTTPCall(Unknown Source) at oracle.webdb.provider.v2.adapter.SOAPServlet.service(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64) at com.peoplesoft.pt.portlet.jpdk.provider.PSProviderFilter.doFilter(PSProviderFilter.java:78) at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15) at com.peoplesoft.pt.portlet.logging.DynamicFilter.doFilter(DynamicFilter.java:83) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:619) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368) at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595)
As our application uses AXIS to do WebServices, we have removed the default oracle xml shared library by using remove-inherited in orion-application.xml. In addition, we package our own xerces in our application ear file. It looks like PDK is looking for oracle xml parser resulting in the NoClassDefFoundError exception.
The above exception is thrown if I access the JDPK provider URL after accessing our application.
However, if I restart the OC4J and ccess the JPDK provider URL without accessing our application, I get the following error
500 Internal Server Error
oracle.classloader.util.AnnotatedLinkageError: class oracle.xml.parser.schema.XSDNode cannot access its superinterface oracle.xml.parser.schema.XSDComponent Invalid class: oracle.xml.parser.schema.XSDNode Loader: oracle.cache:10.1.3 Code-Source: /D:/Oracle/OAS101310/OracleAS_1/LIB/xschema.jar Configuration: (ignore manifest Class-Path) in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar Dependent class: oracle.xml.parser.v2.XMLNode Loader: PeopleSoft2.web.pspc:0.0.0 Code-Source: /D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/xmlparserv2.jar Configuration: WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib at oracle.classloader.PolicyClassLoader.findLocalClass (PolicyClassLoader.java:1462) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.SearchPolicy$FindLocal.getClass (SearchPolicy.java:167) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.SearchSequence.getClass (SearchSequence.java:119) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.SearchPolicy.loadClass (SearchPolicy.java:645) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.SearchPolicy$CheckSharedLibraries.getClass (SearchPolicy.java:396) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.SearchSequence.getClass (SearchSequence.java:119) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1674) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1635) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1620) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@26795951] at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap:1.5.0_06] at oracle.xml.parser.v2.XMLNode. (XMLNode.java:4123) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/xmlparserv2.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.xml.parser.v2.NonValidatingParser. (NonValidatingParser.java:172) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/xmlparserv2.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.xml.parser.v2.XMLParser. (XMLParser.java:174) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/xmlparserv2.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.xml.parser.v2.DOMParser. (DOMParser.java:92) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/xmlparserv2.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.portal.utils.xml.v2.XMLUtil.getParser (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/ptlshare.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.portal.utils.xml.v2.XMLUtil.parseDocument (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/ptlshare.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.portal.provider.v2.http.DefaultProviderLoader.parseRegistry (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.portal.provider.v2.http.DefaultProviderLoader.getProviderDefinition (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.portal.provider.v2.http.DefaultProviderLoader.validate (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.validate (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.showTestPage (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.handleHttp (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native method) [unknown, by unknown] at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) [unknown, by unknown] at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) [unknown, by unknown] at java.lang.reflect.Method.invoke (Method.java:585) [unknown, by unknown] at oracle.webdb.provider.v2.adapter.SOAPServlet.doHTTPCall (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at oracle.webdb.provider.v2.adapter.SOAPServlet.service (Unknown source file) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/lib/pdkjava.jar (from WEB-INF/lib/ directory in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\lib), by PeopleSoft2.web.pspc:0.0.0] at javax.servlet.http.HttpServlet.service (HttpServlet.java:856) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/servlet.jar (from (ignore manifest Class-Path) in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by api:1.4.0] at com.evermind.server.http.ResourceFilterChain.doFilter (ResourceFilterChain.java:64) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.peoplesoft.pt.portlet.jpdk.provider.PSProviderFilter.doFilter (PSProviderFilter.java:78) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/classes/ (from WEB-INF/classes/ in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\classes), by PeopleSoft2.web.pspc:0.0.0] at com.evermind.server.http.EvermindFilterChain.doFilter (EvermindFilterChain.java:15) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.peoplesoft.pt.portlet.logging.DynamicFilter.doFilter (DynamicFilter.java:83) [D:/Oracle/OAS101310/OracleAS_1/j2ee/PeopleSoft2/applications/PeopleSoft2/pspc/WEB-INF/classes/ (from WEB-INF/classes/ in D:\Oracle\OAS101310\OracleAS_1\j2ee\PeopleSoft2\applications\PeopleSoft2\pspc\WEB-INF\classes), by PeopleSoft2.web.pspc:0.0.0] at com.evermind.server.http.ServletRequestDispatcher.invoke (ServletRequestDispatcher.java:619) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.server.http.ServletRequestDispatcher.forwardInternal (ServletRequestDispatcher.java:368) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.server.http.HttpRequestHandler.doProcessRequest (HttpRequestHandler.java:866) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.server.http.HttpRequestHandler.processRequest (HttpRequestHandler.java:448) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.server.http.AJPRequestHandler.run (AJPRequestHandler.java:302) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.server.http.AJPRequestHandler.run (AJPRequestHandler.java:190) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run (ServerSocketReadHandler.java:260) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket (ServerSocketAcceptHandler.java:239) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketAcceptHandler.access$700 (ServerSocketAcceptHandler.java:34) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run (ServerSocketAcceptHandler.java:880) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run (ReleasableResourcePooledExecutor.java:303) [D:/Oracle/OAS101310/OracleAS_1/j2ee/home/lib/oc4j-internal.jar (from in META-INF/boot.xml in D:\Oracle\OAS101310\OracleAS_1\j2ee\home\oc4j.jar), by oc4j:10.1.3] at java.lang.Thread.run (Thread.java:595) [jre bootstrap, by jre.bootstrap:1.5.0_06]On further test, If I let the default oracle xml parser be loaded, then I do not get the the exception.
I have removed the following lines from orion-application.xml
<imported-shared-libraries>
<remove-inherited name="oracle.xml"/>
</imported-shared-libraries>
Now, If I access the JPDK provider URL
http://ple-fjunod.peoplesoft.com:9820/pspc/providers/psprovider/ps/EMPLOYEE
I get the excepted page
Congratulations! You have successfully reached your Provider's Test Page.
Recognizing Portlets...
Recognizing component versions...
ptlshare.jar version: 10.1.3.2.0
pdkjava.jar version: 10.1.3.2.0
Can someone please tell me that if I remove the inherited default oracle XML parser using remove-inherited tag in orion-application.xml, how do I make the JPDK use my own packaged xerces XML parser.
Thanks -
Can't find perl-xml-parser in aur
But I find this page by google:
http://aur.archlinux.org/packages/perl-xml-parser/
Why cant search in aur page?I see, perl-xml-parser is now replaced by current/perlxml
-
XML Parser for PLSQL and BIG5/UTF-8
I'm trying store data in traditional chinese submitted by IE5 (through oXMLHttpRequest.send() and javascript), I tried both 'encoding="BIG5"' and 'encoding="UTF-8"'.
It seems that the parser ignore all characters that are not ascii regardless of their encoding.
Any thoughts will be much appreciated
procedure UpdateXMLProc(xmlSrc varchar2)
is
p xmlparser.parser;
doc xmldom.DOMDocument;
nlist xmldom.DOMNodeList;
list_len pls_integer;
node1 xmldom.DOMNode;
node2 xmldom.DOMNode;
node3 xmldom.DOMNode;
begin
p := xmlparser.newParser;
xmlparser.parseBuffer(p, xmlSrc);
doc := xmlparser.getDocument(p);
nlist := xmldom.getElementsByTagName(doc, 'ROW');
list_len := xmldom.getLength(nlist);
-- loop through elements
for j in 0..list_len-1 loop
node1 := xmldom.item(nlist, j);
-- get primary key values
node2 := xmldom.getFirstChild(node1);
loop
-- get the text node and if not null get value
node3 := xmldom.getFirstChild(node2);
if not xmldom.isNull(node3) then
-- THIS OUTPUT MAY ALTER CHARACTER IF IT'S NOT ASCII
htp.p(xmldom.getNodeValue(node3));
end if;
-- get next field
node2 := xmldom.getNextSibling(node2);
exit when (xmldom.isNull(node2));
end loop;
end loop;
-- THIS OUTPUT WILL BE IN THE SAME ENCODING AS THE ORIGINAL
htp.p(xmlSrc);
end;
nullI just ran the initjvm.sql,initdbj.sql and
initsqlj.sql.
Still getting the error.
Please help!!!!
Thanks
Jay
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jay ([email protected]):
I have Oracle8i Release 8.1.5.0.0 - ProductionWith the Java option
PL/SQL Release 8.1.5.0.0 - Production version
runnig in sun sparc server.
While I am loading Oracle XML Parser for PLSQL(using plxmlparser_V1_0_1.tar.gz) have a problem. When I try to load the xmlparser.jar class and I get the
following messages:
initialization complete
Error while accessing MD5 table
ORA-00942: table or view does not exist
loading : org/w3c/dom/DOMImplementation
Error while loading org/w3c/dom/DOMImplementation
ORA-04068: existing state of packages has been discarded
ORA-04063: package body "TEST.LOADLOBS" has errors
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at line 1
creating : org/w3c/dom/DOMImplementation
Error while creating class org/w3c/dom/DOMImplementation
ORA-00406: COMPATIBLE parameter needs to be 8.1.0.0.0 or greater
Error while accessing MD5 table
ORA-00942: table or view does not exist
loading : org/w3c/dom/html/HTMLDivElement
Error while loading org/w3c/dom/html/HTMLDivElement
ORA-04068: existing state of packages has been discarded
ORA-04063: package body "TEST.LOADLOBS" has errors
ORA-06508: PL/SQL: could not find program unit being called
and so on.
Could anyone please tell me if I need to do any pre-installation steps.
Thanks
Jay<HR></BLOCKQUOTE>
null -
Creating XML File Using xmldom Package
How can I create an XML file from scratch using the PL/SQL xmldom package?
I want to create an XML file using the xmldom package instead of building the individual tags as strings of VARCHAR2 character data. There is quite a bit of documentation regarding manipulating input XML files using DOM -- but not for creating XML files from scratch given known "tagnames" (<lastName>) and retrieved database "values" ("Smith").
<person>
<lastName>Smith</lastName>
</person>
Is there any documentation that you can recommend?
Thank you.Here is an example.
The create_file procedure creates the file.
The other procedures are generic procs that can be used with any XML.
PROCEDURE create_file_with_root(po_xmldoc OUT xmldom.DOMDocument,
pi_root_tag IN VARCHAR2,
po_root_element OUT xmldom.domelement,
po_root_node OUT xmldom.domnode,
pi_doctype_url IN VARCHAR2) IS
xmldoc xmldom.DOMDocument;
root xmldom.domnode;
root_node xmldom.domnode;
root_element xmldom.domelement;
record_node xmldom.domnode;
newelenode xmldom.DOMNode;
BEGIN
xmldoc := xmldom.newDOMDocument;
xmldom.setVersion(xmldoc, '1.0');
xmldom.setDoctype(xmldoc, pi_root_tag, pi_doctype_url,'');
-- Create the root --
root := xmldom.makeNode(xmldoc);
-- Create the root element in the file --
create_element_and_append(xmldoc, pi_root_tag, root, root_element, root_node);
po_xmldoc := xmldoc;
po_root_node := root_node;
po_root_element := root_element;
END create_file_with_root;
PROCEDURE create_element_and_append(pi_xmldoc IN OUT xmldom.DOMDocument,
pi_element_name IN VARCHAR2,
pi_parent_node IN xmldom.domnode,
po_new_element OUT xmldom.domelement,
po_new_node OUT xmldom.domnode) IS
element xmldom.domelement;
child_node xmldom.domnode;
newelenode xmldom.DOMNode;
BEGIN
element := xmldom.createElement(pi_xmldoc, pi_element_name);
child_node := xmldom.makeNode(element);
-- Append the new node to the parent --
newelenode := xmldom.appendchild(pi_parent_node, child_node);
po_new_node := child_node;
po_new_element := element;
END create_element_and_append;
FUNCTION create_text_element(pio_xmldoc IN OUT xmldom.DOMDocument, pi_element_name IN VARCHAR2,
pi_element_data IN VARCHAR2, pi_parent_node IN xmldom.domnode) RETURN xmldom.domnode IS
parent_node xmldom.domnode;
child_node xmldom.domnode;
child_element xmldom.domelement;
newelenode xmldom.DOMNode;
textele xmldom.DOMText;
compnode xmldom.DOMNode;
BEGIN
create_element_and_append(pio_xmldoc, pi_element_name, pi_parent_node, child_element, child_node);
parent_node := child_node;
-- Create a text node --
textele := xmldom.createTextNode(pio_xmldoc, pi_element_data);
child_node := xmldom.makeNode(textele);
-- Link the text node to the new node --
compnode := xmldom.appendChild(parent_node, child_node);
RETURN newelenode;
END create_text_element;
PROCEDURE create_file IS
xmldoc xmldom.DOMDocument;
root_node xmldom.domnode;
xml_doctype xmldom.DOMDocumentType;
root_element xmldom.domelement;
record_element xmldom.domelement;
record_node xmldom.domnode;
parent_node xmldom.domnode;
child_node xmldom.domnode;
newelenode xmldom.DOMNode;
textele xmldom.DOMText;
compnode xmldom.DOMNode;
BEGIN
xmldoc := xmldom.newDOMDocument;
xmldom.setVersion(xmldoc, '1.0');
create_file_with_root(xmldoc, 'root', root_element, root_node, 'test.dtd');
xmldom.setAttribute(root_element, 'interface_type', 'EXCHANGE_RATES');
-- Create the record element in the file --
create_element_and_append(xmldoc, 'record', root_node, record_element, record_node);
parent_node := create_text_element(xmldoc, 'title', 'Mr', record_node);
parent_node := create_text_element(xmldoc, 'name', 'Joe', record_node);
parent_node := create_text_element(xmldoc,'surname', 'Blogs', record_node);
-- Create the record element in the file --
create_element_and_append(xmldoc, 'record', root_node, record_element, record_node);
parent_node := create_text_element(xmldoc, 'title', 'Mrs', record_node);
parent_node := create_text_element(xmldoc, 'name', 'A', record_node);
parent_node := create_text_element(xmldoc, 'surname', 'B', record_node);
-- write the newly created dom document into the buffer assuming it is less than 32K
xmldom.writeTofile(xmldoc, 'c:\laiki\willow_data\test.xml');
EXCEPTION
WHEN xmldom.INDEX_SIZE_ERR THEN
RAISE_APPLICATION_ERROR(-20120, 'Index Size error');
WHEN xmldom.DOMSTRING_SIZE_ERR THEN
RAISE_APPLICATION_ERROR(-20120, 'String Size error');
WHEN xmldom.HIERARCHY_REQUEST_ERR THEN
RAISE_APPLICATION_ERROR(-20120, 'Hierarchy request error');
WHEN xmldom.WRONG_DOCUMENT_ERR THEN
RAISE_APPLICATION_ERROR(-20120, 'Wrong doc error');
WHEN xmldom.INVALID_CHARACTER_ERR THEN
RAISE_APPLICATION_ERROR(-20120, 'Invalid Char error');
WHEN xmldom.NO_DATA_ALLOWED_ERR THEN
RAISE_APPLICATION_ERROR(-20120, 'Nod data allowed error');
WHEN xmldom.NO_MODIFICATION_ALLOWED_ERR THEN
RAISE_APPLICATION_ERROR(-20120, 'No mod allowed error');
WHEN xmldom.NOT_FOUND_ERR THEN
RAISE_APPLICATION_ERROR(-20120, 'Not found error');
WHEN xmldom.NOT_SUPPORTED_ERR THEN
RAISE_APPLICATION_ERROR(-20120, 'Not supported error');
WHEN xmldom.INUSE_ATTRIBUTE_ERR THEN
RAISE_APPLICATION_ERROR(-20120, 'In use attr error');
WHEN OTHERS THEN
dbms_output.put_line('exception occured' || SQLCODE || SUBSTR(SQLERRM, 1, 100));
END create_file; -
Installation of xml parser for PLSQL
Hi,
I hv installed oracle 8.1.7 on windows with
jserver.
and I did following step to install xml parser for PLSQL.
1. loadjava -user usernmae/password@connectstr -r -v xmlparserv2.jar
2. loadjava -user usernmae/password@connectstr -r -v xmlplsql.jar
loading both jar files gives errors like
resolving: oracle/xml/parser/plsql/xmlparsercover
Error while computing shortname of oracle/xml/parser/plsql/xmlparsercover
ORA-29540 - class oracle/aurora/rdbms/dbmsjava does not exists
ORA-06512: in admin.dbms_java line o
ORA-06512: IN LINE 1
i am getting this error for all class..
after thjat i run oracle_home/xdk/plsql/parser/bin/load.sql
and then when i try to run demo example
( oracle_home/xdk/plsql/demo/ )
then its giving following error..
ORA-29541: class ADMIN.oracle/xml/parser/plsql/XMLParserCover could not be
resolved
ORA-06512: at "ADMIN.XMLPARSERCOVER", line 0
ORA-06512: at "ADMIN.XMLPARSER", line 57
ORA-06512: at "ADMIN.DOMSAMPLE", line 72
ORA-06512: at line 1
Does anyone has idea about these errors..
need help urgently..
Thanx
MehulGeoff Hicks (guest) wrote:
: Problems being experienced trying to install the XML parser for
: PL/SQL (zip file plxmlparser_v1_0_0_1_tar.gz).
: We are on Oracle8i (8.1.5.0.0) (with JServer).
: On installing the Oracle XML parser for PL/SQL the following
: errors appear having run the loadjava command line tool for
: xmlparser.jar:-
: loading : META-INF/MANIFEST.MF
: creating : META-INF/MANIFEST.MF
: Error while creating resource META-INF/MANIFEST.MF
: ORA-29547: Java system class not available:
: oracle/aurora/rdbms/Compiler
: loading : xmlparser_1.0.1.4_production
: creating : xmlparser_1.0.1.4_production
: Error while creating resource xmlparser_1.0.1.4_production
: ORA-29547: Java system class not available:
: oracle/aurora/rdbms/Compiler
: Lots of the following resolver errors are returned:-
: resolver :
: Error while resolving class org/w3c/dom/html/HTMLDivElement
: ORA-00904: invalid column name
It looks like you have not initialized JServer in your 8.1.5
database. This needs to be done first.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null -
Create document with PL/SQL xml parser
Hello,
I'm trying to create a document with PL/SQL package xmldom on 8.1.7 and write to a file.
The problem is that my file is empty when it's created.
Can anyone send me an example of this simple problem or fullfill my example so it's works.
As you understand I'm new in using XML. :)
My example is:
declare
doc xmldom.DOMDocument;
n xmldom.DOMNode;
e xmldom.domelement;
t xmldom.domtext;
begin
doc := xmldom.newdomdocument;
t := xmldom.createtextnode(doc, 'ROOT');
n := xmldom.makenode(t);
doc := xmldom.makedocument(n);
xmldom.writetofile(doc, 'd:\orant\xdk\plsql\demo\test.xml');
end;
Regards
HekanYour problem may be memory for the JavaVM. Remember, the PL/SQL
parser uses the Java XML Parser APIs which run in a VM instance.
Are you running Oracle 8i? If you are you can access our Java
XML parser loaded in 8i's VM directly from your PL/SQL code.
That is in fact how our PL/SQL Parser does it.
Finally, we have no experience loading other XML Parsers into
Oracle.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
Premal Mehta (guest) wrote:
: Hi,
: I asked about his a few days back. Pl/SQL parser does not
work
: for XML files of size greater then 500Kb. You replied saying
: that there were no such problem.
: However whenever I try, either I get some exception or
Pl/SQL
: crashes due to memory error. I am clueless. Is there some
: setting that I can do to get away with the problem? Please
: guide...
: Also, tell me about the alternatives.
: Can I write code in Java and load these class filesin Oracle
: and then reference these classes from Pl/SQL code. Can I load
: any other parser for Java in Oracle.
: Looking forward for help...
: Premal.
null -
Hi,
I am using oracle 8.1.7.4
I am using plsql parser (DOM parser by default) to parse a xml document. It takes 2 seconds to parse a doc of size 20K having about 500 tags. task is to parse such 60K documents in a day where concurrent parsing requests might be 1000.
Does anyone know, how to improve the parsing time? I have used xmlparser and xmldom packages(built-in).
Thanks in advance.Thanks Shushant. It helped me.
-
XML parsing - Thanks Andrew Clarke,info you wanted to answer
Andrew ,
First of all thanks for responding.It was indeed very helpful of you.I have put your questions here just and have answered it
" This is a tricky thing to do. Parsing and processing a document in the database is relatively straightforward. Allowing the user to make changes to it is slightly stickier.
Before we can be of any help you need to give us some more info:
Which version of the database are you using? (9i has lots more functionality)
How are you intending to display the information to the user?
Is your user going to be editing the XML tags or just the content?
Are you using XML SCHEMA or DTD?
Do you know there's an XML forum? (Check the jump to any forum drop down)
1)I am using database :- info
Connected to:
Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
With the Partitioning option
JServer Release 8.1.7.0.0 - Production
I hope this information is enough.Another thing i wanted to know is how to check for oracle jvm intallation.Because it is needed for oracle xdk installation.
2) I intend to parse the xml file stored as a blob object in the backend and display the information in the front end ( Oracle forms6i) interface.
3) The user sees only the content and can edit only the content ,issuing save command writes back this data into the xml file and saves it back to the database as the blob object.
Yes i know XML discussion forum,but please can you guide me a little in my direction ,i thought it would be more useful to write in this forum (deals with pl/sql).Atleast a lead is enough.
Can you please suggest some help for the questions that i have:-
1)I don't know whether i have oracle JVM installed.The oracle xdk kit install notes say so.So how to check it and get it.Help notes say that a xdk kit for 9i version will also work with 8i version( backward compatibility ).Can you offer some advice on this whether this is possible( The xdkload utility says so.)
2)Is it possible to,after having build a tree thro' parsing process and to go through it accessing the nodes and the values .Also is it possible to write to this tree at the particular point and have the tree saved back to xml document.This will save me a lot of job.Please feel free to help me or atleast suggest some lead points if you know if this can be done.A hyper link ,if you know,which details these steps are also enough.
Regarding the XML schema or DTD ,please give me some more time.
One last question(if i am not bugging you) when the xdkload utility loads the xdk pl/sql package with -dbver to 8i ,will it support all the command in it to be executed on the 8i backend.
(http://technet.oracle.com/support/tech/xml/xdk_plsql/ softwares section)
Andrew ,i will feel really grateful if you can help me with these issues.Anyway Thanks for taking so much efforts in giving me some tips.
Regards
gopalI hope this information is enough.Another thing i wanted to know is how to check for oracle jvm intallation.Because it is needed for oracle xdk installation.The banner that comes up when you log on shows you that you are running:
JServer Release 8.1.7.0.0 - Production so that means Java is enabled. A good start.
Help notes say that a xdk kit for 9i version will also work with 8i version( backward compatibility ).We are running with XDK 9i in 8173 databases without any major issues. n fact I recommend it, as there are a couple of nasty bugs in the 8i XDK that render it virtually unusable. However there is a whole bunch of functionality in the 9i XDK that relies on the XML datatype that was introduced in the 9i database.
2) I intend to parse the xml file stored as a blob object in the backend and display the information in the front end ( Oracle forms6i) interface.
3) The user sees only the content and can edit only the content ,issuing save command writes back this data into the xml file and saves it back to the database as the blob object.Why not store the data in tables? It is much, much easier to build Forms applications using tables than to build them using XML documents. Disassembling XML documents into tables is relatively straightforward and so is re-constituting them if you ever need to show someone the XML. In Oracle 9i r2 this is what Oracle does by default with the XML datatype.
2)Is it possible to,after having build a tree thro' parsing process and to go through it accessing the nodes and the values .You build the tree using xmlparser.parseClob() followed by xmlparser.getDocument().
You walk the DOM using the methods in the XMLDom package to navigate to any given node. Then you use xmldom.getNodeValue(} to retrieve the data in that node. This only works for nodes of type xmldom.text_node, so you'll need to test for that. It also fails if the node has a null value. Finally bear it mind that according to DOM principles the content of a node is a child[i] of that node.
Given this fragment:
<employee>
<empno>1234</empno>
</employee>I want to get the employee number. So:[list]
[*]I generate a list of empno nodes using node_list := xmldom.getElementsByTagName(x_doc, 'empno');[*]I navigate to the node I want using el := xmldom.item(node_list, 1)};[*]I then navigate to the text using text_node := xmldom.getFirstChild(el);[*]I navigate to the node I want using emp_no := xmldom.getNodeValue(text_node};[list]
There may be whizzier ways of doing it but this way is clear and it works.
Although the documentation that comes with the XDK isn't that bad you will find some additional info in the onlineshttp://technet.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96621/adx20ppl.htm#1656. have a look at the domsample.sql script. It's actually quite helpful.
Also is it possible to write to this tree at the particular point and have the tree saved back to xml document.I haven't done this myself, but I would have thought you would write stuff using the method outlined above but using xmldom.setNodeValue. There are various WriteTo... in the xmldom package.
Now for the bad news. None of this works with BLOBs. You have to use CLOBs, VARCHAR2s or external OS files. Sorry.
Good luck, APC -
?xml version = '1.0' encoding = 'ASCII'? pl/sql xml parser
When ever I parse a document which has the
<?xml version = '1.0' encoding = 'ASCII'?> tag as the first line hangs the pl/sql xml parser . If I remove the "encoding = 'ASCII'" from the file everything works fine ! What is the problem ?
version 8.1.6 / plsql parser v2 / hpux 11x
Here is the input file
<?xml version = '1.0' encoding = 'ASCII'?>
!--- This is a comment -->
<person>
<employee>
<lastname>GHANTASALA</lastname>
<firstname>SREE</firstname>
<age>32</age>
</employee>
<employee>
<lastname>TAMATAM</lastname>
<firstname>SATISH</firstname>
<age>30</age>
</employee>
</person>
Here is my program
declare
p xmlparser.parser;
doc xmldom.DOMDocument;
dir varchar2(100) := '/apps/oracle/drugstore';
errfile varchar2(30) := 'err.txt' ;
inpfile varchar2(30) := 'person.xml';
nl xmldom.DOMNodeList;
len number;
n xmldom.DOMNode;
new_node xmldom.DOMNode;
node_name varchar2(100);
node_value varchar2(100);
begin
-- new parser
p := xmlparser.newParser;
-- Set some characteristics
xmlparser.setValidationMode(p, FALSE);
xmlparser.setErrorLog(p, dir| |'/'| | errfile );
xmlparser.setBaseDir(p, dir);
-- parse input file
xmlparser.parse(p, dir| |'/'| |inpfile);
-- get document
doc := xmlparser.getDocument(p);
-- get all elements
nl := xmldom.getElementsByTagName(doc, '*');
len := xmldom.getLength(nl);
dbms_output.put_line('Length='| |len);
-- loop through elements
for i in 0..len-1 loop
n := xmldom.item(nl, i);
node_name := xmldom.getNodeName(n);
-- get the text node associated with the element node
n := xmldom.getFirstChild(n);
if xmldom.getNodeType(n) = xmldom.TEXT_NODE then
node_value := xmldom.getNodeValue(n);
if node_name='lastname' then
dbms_output.put_line('The value you are looking for is -->:'| |node_value);
if node_value = 'GHANTASALA' then
xmldom.setNodeValue(n,'TEST2');
end if;
end if;
end if;
end loop;
new_node := xmldom.makeNode(doc);
xmldom.writeToFile(new_node, dir | |'/'| |'mod.xml');
end ;
nullThe encoding header is actually generated by
by the following piece of code in my pl/sql program .
new_node := xmldom.makeNode(doc);
xmldom.writeToFile(new_node, dir | |'/'| |'mod.xml');
Since this is a document created by the pl/sql parser, I assume there is some meaning to it !
Also why is it hanging ? PL/sql parser should tell me that it is not a valid string ! -
Hi,
I have to produce and manipulate XML documents in PL/SQL. I have downloaded the XML Parser for PL/SQL from Oracle's web site.
Can anyone please:
1. Point me to some examples illustrating XML DOM manipulation with PL/SQL.
2. Any information about PL/SQL packages used for XML manipulation.
I am using Oracle 8i version 8.1.6
Thanks,
Rossen<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Rossen Petkov ([email protected]):
Hi,
I have to produce and manipulate XML documents in PL/SQL. I have downloaded the XML Parser for PL/SQL from Oracle's web site.
Can anyone please:
1. Point me to some examples illustrating XML DOM manipulation with PL/SQL.
2. Any information about PL/SQL packages used for XML manipulation.
I am using Oracle 8i version 8.1.6
Thanks,
Rossen<HR></BLOCKQUOTE>
Hope this will do something
set serveroutput on
create or replace procedure domsample(dir varchar2, inpfile varchar2, errfile varchar2) is
p xmlparser.parser;
doc xmldom.DOMDocument;
-- Print elements
procedure printElements( doc xmldom.DOMDocument) is
nl xmldom.DOMNodeList;
len number;
n xmldom.DOMNode;
t xmldom.DOMNode;
begin
-- get all elements.
nl := xmldom.getElementsByTagName(doc,'*');
len := xmldom.getLength(nl);
-- loop through elements.
for i in 0..len-1 loop
if xmldom.isnull(nl) = FALSE then
n := xmldom.item(nl,i);
IF xmldom.hasChildNodes(n) then
t := xmldom.getFirstChild(n);
dbms_output.put(xmldom.getNodeName(n) | |':');
dbms_output.put_line(xmldom.getNodeValue(t));
end if;
end if;
end loop;
dbms_output.put_line(' ');
end printElements;
-- print the attributes of each element in a document.
procedure printElementAttributes(doc xmldom.DOMDocument) is
nl xmldom.DOMNodelist;
len1 number;
len2 number;
n xmldom.DOMNode;
e xmldom.DOMElement;
nnm xmldom.DOMNamedNodeMap;
attrname varchar2(100);
attrval varchar2(100);
begin
-- get all Elements
nl := xmldom.getElementsByTagName(doc,'*');
len1 := xmldom.getLength(nl);
-- loop through elements.
for j in 0 .. len1 - 1 loop
n := xmldom.item(nl,j);
e := xmldom.makeElement(n);
dbms_output.put_line(xmldom.getTagName(e) | | ':');
-- get all attributes of element
nnm := xmldom.getAttributes(n);
if (xmldom.isNull(nnm) = FALSE) then
len2 := xmldom.getLength(nnm);
-- loop through attributes
for i in 0..len2 -1 loop
n := xmldom.item(nnm,i);
attrname := xmldom.getNodeName(n);
attrval := xmldom.getNodeValue(n);
dbms_output.put(' '| |attrname| |' = '| |attrval);
end loop;
dbms_output.put_line(' ');
end if;
end loop;
end printElementAttributes;
begin
-- new parser.
p := xmlparser.newParser;
-- set some charecterstics.
xmlparser.setValidationMode(p,FALSE);
xmlparser.setErrorLog(p, dir| |'/'| |errfile);
xmlparser.setBaseDir(p,dir);
-- parse input file
xmlparser.parse(p,dir| |'/'| |inpfile);
-- get document
doc := xmlparser.getDocument(p);
-- print document elements.
dbms_output.put_line('The elements are: ');
printElements(doc);
-- print document element attributes
dbms_output.put_line('The attributes of each element are: ');
printElementAttributes(doc);
-- deal with exception
exception
when xmldom.INDEX_SIZE_ERR then
raise_application_error(-20120,'Index Size Error');
when xmldom.DOMSTRING_SIZE_ERR then
raise_application_error(-20120,'String Size Error');
when xmldom.HIERARCHY_REQUEST_ERR then
raise_application_error(-20120,'Hierarchy Request Error');
when xmldom.WRONG_DOCUMENT_ERR then
raise_application_error(-20120,'Worng Document Error');
when xmldom.INVALID_CHARACTER_ERR then
raise_application_error(-20120,'Invalid Character Error');
when xmldom.NO_DATA_ALLOWED_ERR then
raise_application_error(-20120,'No Data Allowed Error ');
when xmldom.NO_MODIFICATION_ALLOWED_ERR then
raise_application_error(-20120,'No Modification Allowed Error');
when xmldom.NOT_FOUND_ERR then
raise_application_error(-20120,'Not Found Error');
when xmldom.NOT_SUPPORTED_ERR then
raise_application_error(-20120,'Not Supported Error');
when xmldom.INUSE_ATTRIBUTE_ERR then
raise_application_error(-20120,'In Use Attribute Error');
end domsample;
show errors;
Cheers
Srianth
Maybe you are looking for
-
Path is correct, still won't work
Sup, total noob here. I'm doing the Hello World tutorial, and I compiled it successfully (path worked, all i had to do was type "javac HelloWorldApp.java") and then I tried to run it with "java HelloWorldApp" Now I get the Exception in thread "main"
-
When trying to do a system backup to my remote LaCie hard drive, what does it mean when I get a message that says "waiting for volume LaCie disk"? While this message apears no back-up occurs. Is there a setting I need to change?
-
Purchase order Goods received not invoiced.
Hi, Is there any transaction ? where i can find Purchase order goods received and not invoiced. Thanks..Gopi
-
Error in Portal when checking MSS role, Help me how to solve?
In portal when I click on MSS I am getting an error like... Portal Runtime Error An exception occurred while processing a request for : iView : pcd:portal_content/com.sap.pct/line_manager/com.sap.pct.erp.mss.bp_folder/com.sap.pct.erp.mss.roles/com.sa
-
Cash Journal For different Cureencies
Hi, We want to create multiple cash journals for different currencies? For example, for USD bank account we want to create two cash journal one for USD and one for EUR. Can we do that? Regards, Nand