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)
Similar Messages
-
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 -
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:
nullI 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 -
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 -
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 -
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 -
Hi-
I'm trying to use the latest Xercies/Xalan classes in OC4J 10.1.3 as described in the How-To swap XML Parsers document:
http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html
What I can see happening is that the oracle.xml shared library is successfully 'turned off', but the xalan libraries are not added. Instead, the default xml classes that are distributed with the JDK become visible. For instance, using a slightly modified version of the index.jsp page from the how-to, I get this result:
------ Output from JSP page ----------------
TransformerFactory Instance: org.apache.xalan.processor.TransformerFactoryImpl
Transformer Instance: org.apache.xalan.transformer.TransformerIdentityImpl
Transformer Version: Xalan Java 2.4.1 (!!)
What I expect is for that last line to say version 2.7.0, which is the version of the xalan.jar included in my shared library (code to add that line to the how-to shown below).
I suspect what is happening is that the class loader is simply not letting a shared library override a system library - to do that you probably need to place the jar files in system endorsed directory.
Has anyone gotten this how-to to work - actually replacing the XML parser/transform classes with the latest Xalan classes? Are you sure it is seeing the current version you placed in the shared library?
Thanks,
Eric Everman
---- My modified getXSLTDetails() method in the index.jsp page of the how-to -------
<!-- Additional Import -->
<%@ page import="org.apache.xalan.Version" %>
public static String getXSLTDetails()
Transformer transformer=null;
TransformerFactory transformerfactory = TransformerFactory.newInstance();
Version ver = null;
String br = "<" + "br" + ">"; //otherwise the otn forum chocks on the break.
try
transformer = transformerfactory.newTransformer();
ver = (Version) transformer.getClass().forName("org.apache.xalan.Version").newInstance();
String ret_val =
"TransformerFactory Instance: "+transformerfactory.getClass().getName() + br +
"Transformer Instance: "+transformer.getClass().getName() + br;
if (ver != null) {
ret_val = ret_val + "Transformer Version: " + ver.getVersion() + br;
} else {
ret_val = ret_val + "Transformer Version not Available" + br;
return ret_val;
catch (Exception e)
e.printStackTrace();
return e.getMessage();
}--------------------------------------------------------------------Steve - Thanks for responding on this.
The Xalan SQL extension is built into Xalan. The most painless way to try it out is to run it via JEdit: www.jedit.org
JEdit a OS Java application with a fairly painless install process (I'm assuming you already have a current JRE installed). Once its installed, you'll need to install the XSLT plugin - in JEdit goto Plugins | Plugin Manager | Install and pick the XSLT plugin. You'll need the Oracle JDBC classes on your classpath - this can be done by copying the oracle_jdbc4.jar into the [JEdit install directory]/jars directory.
Restart to load that jar and you should be all set.
I included a sample XSLT page at the bottom of this post that is somewhat of a template transform for the SQL extension - its more complicated then it needs to be, but it does some nice things with the results of the query. Save it as a file and make the appropriate changes to the 'datasource' parameter near the top of the file.
Then in JEdit, open the file and make sure the XSLT plugin is visible (Plugins | XSLT | XSLT Processor Toggle - or alternately dock it in the window via global prefs). In the XSLT plugin: Allow the current buffer to be used as the source, Add that same file as a stylesheet via the '+' button, and pick a result file at the bottom. Then click the 'Transform XML' button.
Troubleshooting: I seem to remember having some classpath errors when I tried this on windows, but others have had it work w/o issues. I do remeber that the XSLT plugin had a popup window that gave a pretty good explaintion of the problem, if it occurs. Also, for some reason the XSLT plugin will not create a new file for the output, so its often best to create a file first, then choose it as the output. Of course, you can always run a transformation from the command line or w/in an applicatoin. Full docs on the Xalan SQL extension can be found at: http://xml.apache.org/xalan-j/extensionslib.html#sql
Here is my sample XSLT transform using the SQL extension:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sql="http://xml.apache.org/xalan/sql"
xmlns:str="http://exslt.org/strings"
xmlns:xalan="http://xml.apache.org/xalan"
extension-element-prefixes="sql str xalan">
<xsl:output indent="yes"/>
<xsl:param name="driver">oracle.jdbc.OracleDriver</xsl:param>
<xsl:param name="datasource">jdbc:oracle:thin:jqpublic/jqpublic@server_name:1521:dbname</xsl:param>
<xsl:param name="jndiDatasource"><!-- jndi source for production use w/in enterprise environment --></xsl:param>
<xsl:param name="debug">true</xsl:param>
<xsl:variable name="connection" select="sql:new()"/>
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
<!--
The query: You could pass parameters in to this query to build a where clause, but here is a simple example.
Also, its nice to wrap the query with a max row number to prevent huge results.
-->
<xsl:param name="query">
select * from (
SELECT
'One' FIELD_1,
'Two' FIELD_2
FROM DUAL
) where rownum < 100
</xsl:param>
<!-- Essentially, create a XConnection object -->
<xsl:variable name="connection" select="sql:new()"/>
<xsl:template match="/">
<xsl:choose><!-- Connect using JNDI -->
<xsl:when test="$jndiDatasource != ''">
<xsl:if test="not(sql:connect($connection, $jndiDatasource))">
<xsl:message>Failed to connect to db via jndi connection</xsl:message>
<xsl:comment>Failed to connect to db via jndi connection</xsl:comment>
<xsl:if test="$debug = 'true'">
<xsl:copy-of select="sql:getError($connection)/ext-error"/>
</xsl:if>
</xsl:if>
</xsl:when>
<xsl:otherwise><!-- Connect using connection string -->
<xsl:if test="not(sql:connect($connection, $driver, $datasource))">
<xsl:message>Failed to connect to db via driver/url connection</xsl:message>
<xsl:comment>Failed to connect to db via driver/url connection</xsl:comment>
<xsl:if test="$debug = 'true'">
<xsl:copy-of select="sql:getError($connection)/ext-error"/>
</xsl:if>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<!--
The results of the query. The rowset is brought back in 'streaming' mode,
so its not possible to ask it for the number of rows, or to check for zero
rows. There is a switch to disable streaming mode, but this requires all
rows to be brought into memory.
-->
<xsl:variable name="table" select="sql:query($connection, $query)"/>
<xsl:if test="not($table)">
<xsl:message>Error in Query</xsl:message>
<xsl:copy-of select="sql:getError($connection)/ext-error"/>
</xsl:if>
<page>
<!-- Your xalan environment -->
<xsl:copy-of select="xalan:checkEnvironment()"/>
<!-- Build a bunch of metadata about the rows -->
<meta>
<cols>
<xsl:apply-templates select="$table/sql/metadata/column-header"/>
</cols>
</meta>
<rowset>
<!--
With streaming results, you must use the apply-temmplates contruct,
not for-each, since for-each seems to attempt to count the rows, which
returns zero.
-->
<xsl:apply-templates select="$table/sql/row-set"/>
</rowset>
</page>
<xsl:value-of select="sql:close($connection)"/><!-- Always close -->
</xsl:template>
<xsl:template match="row">
<row>
<xsl:apply-templates select="col"/>
</row>
</xsl:template>
<xsl:template match="column-header">
<col>
<xsl:attribute name="type">
<xsl:value-of select="@column-typename"/>
</xsl:attribute>
<xsl:attribute name="display-name">
<xsl:call-template name="create-display-name"/>
</xsl:attribute>
<xsl:value-of select="@column-name"/>
</col>
</xsl:template>
<!-- Convert column names to proper caps: MY_FIELD becomes My Field -->
<xsl:template name="create-display-name">
<xsl:variable name="col-name">
<xsl:for-each select="str:tokenize(@column-name, '_')">
<xsl:value-of
select="concat(translate(substring(., 1, 1), $lowercase, $uppercase), translate(substring(.,2), $uppercase, $lowercase), ' ')"/>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="substring($col-name, 1, string-length($col-name) - 1)"/>
</xsl:template>
<!-- Creates data columns named 'col' with a column-name attribute -->
<xsl:template match="col">
<col>
<xsl:attribute name="column-name"><xsl:value-of select="@column-name"/></xsl:attribute>
<xsl:value-of select="."/>
</col>
</xsl:template>
</xsl:stylesheet> -
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 -
XML parsing failed while select from my table with criteria
While select from my table an error displayed as
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00601: Invalid token in: '/<XML Path>/row[c24="SA0010001"]'
select * from category
where existsNode(xmlrecord, '/<XML Path>/row[c24="SA0010001"]') = 1;
xmlrecord
<row id="52843" xml:space="preserve">
<c1>Refund of Domestic Payment Order</c1>
<c2>Ref Dom Py Or</c2>
<c3>PLsql</c3>
<c20>1</c20>
<c21>62_TAABSINPUTT___OFS_TAABS</c21>
<c22>0803181605</c22>
<c23>62_TAABSINPUTT_OFS_TAABS</c23>
<c24>SA0010001</c24>
<c25>1</c25>
</row>Hi,
Did you copy that sample from some demo?
The part "<XML Path>" is meant to be replaced by a real XPath fragment.
Here, I think you may just want this :
select * from category
where existsNode(xmlrecord, '/row[c24="SA0010001"]') = 1;Edit : OK, just seen your previous post and the example given
Edited by: odie_63 on 6 juil. 2010 21:16 -
XML Parser Message: Element series is not valid for the content model
Hello,
I work with FrameMaker 8 and DITA.
I change the element prodinfo in the topic.edd from:
General rule: (prodname), (vrmlist), (brand | series | platform | prognum | featnum | component)*
to:
General rule: (brand | series | platform | component)*
When I import the element definition to the template everything is okay.
When I insert the elements metadata, prodinfo, brand, series, platform and component into a topic I get the XML Parser Message that the element brand is not valid for the content model (prodname,vrmlist, ((brand|series|platform|prognum|featnum|component))*).
When I delete the element brand in the topic I get the XML Parser Message that the element series is not valid for the content model (prodname,vrmlist, ((brand|series|platform|prognum|featnum|component))*).
I change the element prodinfo in the topic.edd to:
General rule: (brand)?, (series)?, (platform)?, (component)?
...and get the same Parser Message.
I do not understand that. Is not it allowed to change the EDD this way without changing the DTD?
With kind regards
NinaHi Nina...<br /><br />In general, the EDD and DTD need to sync up. You can remove elements from an EDD element definition's general rule, as long as the resulting elements are still valid to the DTD. But if changing a general rule creates an invalid structure, you'll need to also change the DTD to allow the revised structure.<br /><br />With DITA, it is common to remove inline elements from block-level elements. For example, you might want to remove the <msgblock>, <msgnum>, and <msgph> elements from the general rule of the <p> element .. this can be done easily in the EDD and the resulting structure remains valid with the DTD.<br /><br />However, what you're doing leaves the <brand> element as a child of <prodinfo> .. which is invalid. You'll get these errors when saving a file, since this is when the file is validated against the DTD.<br /><br />I do not recommend modifying the structure in such a way that requires you to modify the DTD. If you really need to do this, then you should consider making a specialization to support your revised model.<br /><br />I hope this helps.<br /><br />Cheers and Happy New Year!<br /><br />...scott
-
RSS - Rolling News - XML Parsing - Accessing KM...
Hello everyone! I am trying to make an iview wich shows rolling news through RSS Feeds, and filtering its content with XLS.
I´ve downloaded an example "Simple XML Parsing iview" and uploaded it into the portal. The thing is that the iview is quite limited because the XSL file has to be in the internet; but i need to have de XLS in the KM, i mean, i need the iview to accept paths like :
http://suarbulpd1d01:50100/irj/go/km/docs/documents/DocumentosPortal/RecursosPortal/Varios/rss-html.xsl
Don´t know how could i modify the code to so i can achieve this.. here it goes:
package com.portalsamples.simplexml;
import java.io.*;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import com.sapportals.portal.prt.component.*;
public class simplexsl extends AbstractPortalComponent
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
IPortalComponentProfile profile = request.getComponentContext().getProfile();
Writer out = response.getWriter();
try
//Creates an instance of the transformer
TransformerFactory tFactory = TransformerFactory.newInstance();
//Pulls XMLSource and XSLSource from the iView Profile
Source xmlSource = new StreamSource(profile.getProperty("xmlsource"));
Source xslSource = new StreamSource(profile.getProperty("xslsource"));
response.write(xslSource.toString());
Transformer transformer = tFactory.newTransformer(xslSource);
//Places resulting HTML into the response
transformer.transform(xmlSource, new StreamResult(out));
catch (Exception e)
response.write(e.getMessage());
Any help will be rewarded...
Regards, Marco.Hello, this is my new code; although it is limited to only accessing xsl files inside the par, it works perfectly. If you want the complete par for rolling news, my mail is [email protected] .
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
IPortalComponentProfile profile = request.getComponentContext().getProfile();
Writer out = response.getWriter();
try
TransformerFactory tFactory = TransformerFactory.newInstance();
//Pulls XMLSource and XSLSource from the iView Profile
Source xmlSource = new StreamSource(profile.getProperty("xmlsource"));
String location= request.getPublicResourcePath()+"/xsl/"+profile.getProperty("xslsource");
File f = new File(location);
Source XSLSou = new StreamSource(f);
Transformer transformer = tFactory.newTransformer(XSLSou);
transformer.transform(xmlSource, new StreamResult(out));
catch (Exception e)
response.write(e.getMessage());
Greetings,
Marco. -
Xml parser configuration prooblem
Hi
The application I am running is trying to use the Following XML parser
"org/apache/xerces/framework/XMLParser" . BUT i get a NoClassDefFoundError
when i run it. I tam not sure which jar i have to use.
Please can u suggest me ...
1 > HOW to change the Default XML parser used by an application ...
a > BY modifying some File provided by SUN for eg .
b > BY adding JVM parameter before running app.
2> List of Jars which contain this Class
Basically i know that XML parser used by an APP can be changed .
Please can u suggest a solution using point 1a ) or 1b
Thanks
sbelurAccording to the javadocs
http://xml.apache.org/xerces2-j/javadocs/xerces2/index.html
you want to use this:
org.apache.xerces.parsers.XMLParser
I suggest you study Xerces some more, or check out the examples that you get with the source package. -
I have parsed the following xml document with the oraxml batch
and with the sample '..\xdk\demo\java\parser\dom\DOMSample' and
observed a diffent behavior in Oracle9i:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Document xmlns:n1='urn:example:some-names'
xmlns:n2='urn:example:some-names'>
<BadAttrs_XML_1.0 att='1' att='2' />
<BadAttrs_Namespaces n1:att='1' n2:att='2' />
<OKAttrs_XML_1.0 att='1' n2:att='2' />
</Document>
----------------------------1.) oraxml
C:\oracle\ora9011\xdk\demo\java\parser\dom>oraxml -version
-warning Namespaces2.xml
Parser version: Oracle XDK Java 9.0.1.0.0 Production
The input XML file is parsed without errors using partial
validation mode
Oraxml does not recognize the two attributes with the same name
in element 'BadAttrs_XML_1.0' as an error.
2.) oracle.xml.parser.v2.DOMParser
C:\oracle\ora9011\xdk\demo\java\parser\dom>java DOMSample
Namespaces2.xml
file:Namespaces2.xml<Line 8, Column 38>: XML-0124: (Fata
l Error) An attribute cannot appear more than once in the same
start tag.
oracle.xml.parser.v2.XMLParseException: An attribute cannot
appear more than once in the same start tag.
I have modified the DomSample.java. The DomParser just checks for
well-formed documents and doesn't validate the document anymore.
(only a comment before
parser.setValidationMode(DOMParser.DTD_VALIDATION);)
My question is:
Is there really a difference between oracle.xml.parser.v2.oraxml
and oracle.xml.parser.v2.DOMParser or which parameters do I have
to use to get the same results?
With Oracle8i, both report an xml error!!
(Oracle9i, Win2000, JDK1.3)
Thanx in advance!
MarkusIt would appear that there is a difference when a loadjava is given a jar vs. the individual class files. When I load the jar, I get the previously described error, but when I load the individual class files (the same class files that the jar contains) the error goes away.
Why? -
Weblogic 6.1 and xml parser empty elements
FYI, It looks like Weblogic changed there xml parser in the transition from
6.0sp2 to 6.1. Example : The empty Extra Info Class produced and error,
because it is empty. Where in 6.0sp2 it did not produce and error:
<taglib>
<tag>
<name>indexProperty</name>
<info>
some info..
</info>
<tagclass>com.pssg.jsp.tags.IndexPropertyTag</tagclass>
<teiclass></teiclass>
</tag>
</taglib>
####<Aug 20, 2001 12:20:52 PM PDT> <Info> <HTTP> <devlwebejb1> <camserver>
<ExecuteThread: '14' for queue: 'default'> <> <> <101047>
<[WebAppServletContext(7008653,cam,/cam)] resolved taglib uri '/pssglibtags'
to taglib-location /WEB-INF/tlds/pssgtaglib.tld:>
####<Aug 20, 2001 12:20:53 PM PDT> <Info> <HTTP> <devlwebejb1> <camserver>
<ExecuteThread: '14' for queue: 'default'> <> <> <101160> <Deployment
descriptor is malformed, check against the DTD:
org.xml.sax.SAXParseException: The content of element type "tag" must match
"(name,tagclass,teiclass?,bodycontent?,info?,attribute*)"..>
####<Aug 20, 2001 12:20:53 PM PDT> <Error> <HTTP> <devlwebejb1> <camserver>
<ExecuteThread: '14' for queue: 'default'> <> <> <101020>
<[WebAppServletContext(7008653,cam,/cam)] Servlet failed with Exception>
weblogic.servlet.jsp.JspException: (line 1): Error in using tag library
uri='/pssglibtags' prefix='pssglibtag': For tag 'indexProperty', cannot load
extra info class ''
at
weblogic.servlet.jsp.StandardTagLib.tld_jspException(StandardTagLib.java:901
-Scothi,
there are two versions of ldap supported in wls6.1 , ldapv1 and ldavp2
ldap v1 only has the functionality of listing groups.
but where ldapv2 doesn't have that functionality,
by looking at your config , it seems you are using ldap v2..
if u need that functionality u can use ldapv1.
thanks
kiran
"Bert Cliche" <[email protected]> wrote in message
news:[email protected]..
Per a proof of concept, I am having trouble getting WL6.1 to see
group members as defined in iPlanet LDAP. I can see the groups,
but modifies to create groups only create them in the local DB.
Created users also only get placed in the local DB. I can bind
for searches as Directory Manager via ldapsearch and run queries,
and the DS gateway works fine. I can dump the LDIF file and the
entries look fine.
I copied and modified the template for the Netscape server and
have the realm setup per the GUI.
For sanity, everything is very generic as:
the Root DN is "o=test.org"
and my "Configuration" part from the config.xml looks like:
server.authprotocol=simple;
server.host=localhost;
membership.filter=(&(uniquemember=%M)(objectclass=groupofuniquenames));
server.port=390;
group.dn=o=test.org;
group.filter=(&(cn=%g)(objectclass=groupofuniquenames));
server.principal=cn=Directory Manager;
user.dn=o=test.org;
server.groupiscontext=false;
user.filter=(&(uid=%u))
I added the "authprotocol" as a guess. Note that the server is
running on port 390, this is not a typo.
Any ideas what is going wrong? -
How can I use a 3rd party XML parser such as xerces with OC4J ?
Hi all tech experts,
I am using Oracle Application Server 10g Release 2 (10.1.2) and i have
installed Portal and Wireless and OracleAS Infrastructure on the same
computer.
i tried all the solutions on this thread
Use of Xerces Parser in out application with Oracle App Server 9.0.4
but still fighting.
I have also posted this query on OTN on following thread
How can I use a 3rd party XML parser such as xerces with OC4J?
but no reply....
Please help me on this issue.
Since OC4J is preconfigured to use the Oracle XML parser which is xmlparserv2.jar.
i have read the following article which states that
OC4J is preconfigured to use the Oracle XML parser. The Oracle XML parser is fully JAXP 1.1 compatible and will serve the needs of applications which require JAXP functionality. This approach does not require the download, installation, and configuration of additional XML parsers.
The Oracle XML parser (xmlparserv2.jar) is configured to load as a system level library of OC4J through it's inclusion as an entry in the Class-Path entry of the oc4j.jar Manifest.mf file. This results in the Oracle XML parser being used for all common deployment and packaging situations. You are not permitted to modify the Manifest.mf file of oc4j.jar.
It must be noted that configuring OC4J to run with any additional XML parser or JDBC library is not a supported configuration. We do know customers who have managed to successfully replace the system level XML parser and the Oracle JDBC drivers that ship with the product, but we do not support this type of configuration due to the possibility of unexpected system behavior and system errors that might occur from replacing the tested and certified libraries.
If you absolutely must use an additional XML parser such as xerces, then you have to start OC4J such that the xerces.jar file is loaded at a level above the OC4J system classpath. This can be accomplished using the -Xbootclasspath flag of the JRE.
i have also run the following command
java -Xbootclasspath/a:d:\xerces\xerces.jar -jar oc4j.jar
but no success.
How could i utilize my jar's like xerces.jar and xalan.jar for parsing instead of OC4J in-built parser ?
All reply will be highly appreciated.
Thnx in advance to all.
Neeraj Sidhaye
try_catch_finally @ Y !Hi Neeraj Sidhaye,
I am trying to deploy a sample xform application to the Oracle Application Server (10.1.3). However, I encountered the class loader issue that is similar to your stuation. I tried all the three solutions but the application is still use the Oracle xml paser class. I am wondering if you have any insight about this?
Thanks for your help.
Xingsheng Qian
iPass Inc.
Here is the error message I got.
Message:
java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
Stack Trace:
org.chiba.xml.xforms.exception.XFormsException: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
at org.chiba.xml.xforms.Container.initModels(Unknown Source)
at org.chiba.xml.xforms.Container.init(Unknown Source)
at org.chiba.xml.xforms.ChibaBean.init(Unknown Source)
at org.chiba.adapter.servlet.ServletAdapter.init(ServletAdapter.java:153)
at org.chiba.adapter.servlet.ChibaServlet.doGet(ChibaServlet.java:303)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
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)
Caused by: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
at org.chiba.xml.xforms.Instance.iterateModelItems(Unknown Source)
at org.chiba.xml.xforms.Bind.initializeModelItems(Unknown Source)
at org.chiba.xml.xforms.Bind.init(Unknown Source)
at org.chiba.xml.xforms.Initializer.initializeBindElements(Unknown Source)
at org.chiba.xml.xforms.Model.modelConstruct(Unknown Source)
at org.chiba.xml.xforms.Model.performDefault(Unknown Source)
at org.chiba.xml.xforms.XFormsDocument.performDefault(Unknown Source)
at org.chiba.xml.xforms.XFormsDocument.dispatchEvent(Unknown Source)
at org.apache.xerces.dom.NodeImpl.dispatchEvent(Unknown Source)
... 18 more
Maybe you are looking for
-
When I click on details, it says Problem Event Name is BEX. The window that pops up is the same that would show up if Firefox freezes.
-
MacBook (late 2008) is really slow
Hi folks, so here's the situation. My gf's late 2008 MacBook ist annoyingly slow. I have 8 tabs open in Safari and when going back and forth between those tabs it gives me the spinning beachball for like 30 seconds. Sometimes it even reloads the whol
-
Howdy, I insert my PSE 11 WN install DVD (WN 7 Pr0 64 OS). Auto play window opens and I click on "open folder to view files". Can't find a file with which to start or "run" the DVD so I may install PSE 11. No help found in the box "getting started" p
-
I purchased a new laptop and tried to move my itunes to it .when I updated the software I didnt get my purchased apps and it wiped out my loaded music library can I get it back
-
Why havent i got a shipping confermation?
when i check my order status it says expected ship date is 10/3/12 and order has been sent for proccessing today it the 4th and still nothing my phone was a supposed to ship yesterday and it hasnt what is going on?