Parse for Ints???
I am creating a basic GUI and am having trouble with the following: see code below
String description = this.txtDescription.getText();
double qty = Double.parseDouble(this.txtQty.getText());
double lineCost = Double.parseDouble(this.txtLineCost.getText());I want to change my qty to an int but am unsure how to convert an int like I am converting the double via the Double.parseDouble method.
All help appreciated.
or:
* Convert a String to an int. The string must only contain digits and a leading minus sign.
* @param value String value to convert.
* @return Integer value of <I>value</I> or Integer.MIN_VALUE if conversion failed.
static public int toInt(String value) {
int result = Integer.MIN_VALUE;
if (value != null) {
try {
result = Integer.parseInt(value.trim());
} catch (NumberFormatException nfe) { /* ignore */ }
return result;
}//toInt()
Similar Messages
-
XML Parser for Java v2. Applying XSLT to DOM tree
I encountered pretty weird behavior of XML Parser for Java v2.
While applying XSLT to XML document created in memory using DOM
interface I couldn't access element attributes. For example,
given the XML document:
<root>
<Item ID="00001">Value of Item 00001</Item>
<Item ID="00002">Value of Item 00002</Item>
</root>
and XSLT:
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>XSLT Test</TITLE>
</HEAD>
<BODY>
<xsl:for-each select="/Error">
<H1>Error</H1><xsl:value-of select="."/>
</xsl:for-each>
<TABLE border="0" cellspacing="0" cellpadding="2">
<TBODY>
<xsl:for-each select="/root">
<TR>
<TH style="background-color:khaki">
<xsl:text>Attribute</xsl:text>
</TH>
<TH style="background-color:khaki">
<xsl:text>Value</xsl:text>
</TH>
</TR>
<xsl:for-each select="Item">
<TR>
<TD><xsl:value-of select="@ID"/></TD>
<TD><xsl:value-of select="."/></TD>
</TR>
</xsl:for-each>
</xsl:for-each>
</TBODY>
</TABLE>
</BODY>
</HTML>
</xsl:template>
If I build DOM tree by parsing XML file the resulting HTML
document after applying XSLT will display
Attribute Value
00001 Value of Item 00001
00002 Value of Item 00002
But if I build DOM tree using following code:
XMLDocument xDoc = new XMLDocument();
Element root = xDoc.createElement( "root" );
xDoc.appendChild( root );
Element elem = xDoc.createElement( "Item" );
elem.setAttribute( "ID", "00001" );
root.appendChild( elem ).
appendChild( xDoc.createTextNode( "Value of Item 00001" ) );
elem = xDoc.createElement( "Item" );
elem.setAttribute( "ID", "00002" );
root.appendChild( elem )
.appendChild( xDoc.createTextNode( "Value of Item 00002" ) );
the same XSLT will produce the following HTML output:
Attribute Value
Value of Item 00001
Value of Item 00002
So the value for the ID attribute is not displayed. At the same
time I can access this attribute using DOM interface. For
example, following code
NodeList nList = xDoc.getElementsByTagName( "Item" );
Element e;
for( int i = 0; i < nList.getLength(); i++ )
e = (Element)nList.item( i );
System.out.println( "ID: " + e.getAttribute( "ID" ) );
produces an output
ID: 00001
ID: 00002
Here is the code for applying XSLT to DOM tree:
DOMParser parser = new DOMParser();
parser.parse( new FileInputStream( "test.xsl" ) );
XMLDocument xsldoc = parser.getDocument();
XSLStylesheet xsl = new XSLStylesheet( xsldoc, createURL( "" ) );
XMLDocument out = new XMLDocument();
out.appendChild( new XSLProcessor().processXSL(xsl, xDoc) );
out.print( new FileOutputStream( "test.html" ) );
Andrei Filimonov
nullWe are not getting what you're getting on Solaris. See the
following:
Script started on Tue Jun 22 18:53:56 1999
Processing /view/test/vobs/oracore3/.ndeprodrc.csh
Processing /private/.nderc.csh
[test] > cat bruno.xml
<my_grandpa age="88">
<my_dad age="66">
<me age="44">
<my_son age="22">
</my_son>
</me>
</my_dad>
</my_grandpa>
[test] > cat bruno.xsl
<?xml version="1.0"?>
<!-- Identity transformation -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
<xsl:template match="me">
<xsl:value-of select="my_son/@age"/>
<xsl:value-of select="@age"/>
<xsl:value-of select="../@age"/>
<xsl:value-of select="../../@age"/>
</xsl:template>
</xsl:stylesheet>
[test] > java XSLSample bruno.xsl bruno.xml
<root>
22446688
</root>
[test] > exit
script done on Tue Jun 22 18:54:22 1999
What platform are you on and does your stylesheet and xml doc
match ours?
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
Bruno Bontempi (guest) wrote:
: I had a similar problem in accessing element attributes from
an
: XSLT sheet.
: It seems like the processor correctly accesses element
attributes
: in the context node, but does not retrieve values of
attributes
: outside the context node.
: For example, for an XML document like:
: <my_grandpa age="88">
: <my_dad age="66">
: <me age="44">
: <my_son age="22">
: </my_son>
: </me>
: </my_dad>
: </my_grandpa>
: and an XSL stylesheet like:
: <xsl:template match="me">
: <xsl:value-of select="my_son/@age"/>
: <xsl:value-of select="@age"/>
: <xsl:value-of select="../@age"/>
: <xsl:value-of select="../../@age"/>
: </xsl:template>
: I expect an output like:
: 22446688
: but all I get is
: 44
: I am also using Jim Clark's XT, which is returning the
expected
: result.
: Thanks in advance for your help,
: Bruno.
: Andrei Filimonov (guest) wrote:
: : I encountered pretty weird behavior of XML Parser for Java
v2.
: : While applying XSLT to XML document created in memory using
DOM
: : interface I couldn't access element attributes. For example,
: : given the XML document:
: : <root>
: : <Item ID="00001">Value of Item 00001</Item>
: : <Item ID="00002">Value of Item 00002</Item>
: : </root>
: : and XSLT:
: : <xsl:template match="/">
: : <HTML>
: : <HEAD>
: : <TITLE>XSLT Test</TITLE>
: : </HEAD>
: : <BODY>
: : <xsl:for-each select="/Error">
: : <H1>Error</H1><xsl:value-of select="."/>
: : </xsl:for-each>
: : <TABLE border="0" cellspacing="0" cellpadding="2">
: : <TBODY>
: : <xsl:for-each select="/root">
: : <TR>
: : <TH style="background-color:khaki">
: : <xsl:text>Attribute</xsl:text>
: : </TH>
: : <TH style="background-color:khaki">
: : <xsl:text>Value</xsl:text>
: : </TH>
: : </TR>
: : <xsl:for-each select="Item">
: : <TR>
: : <TD><xsl:value-of select="@ID"/></TD>
: : <TD><xsl:value-of select="."/></TD>
: : </TR>
: : </xsl:for-each>
: : </xsl:for-each>
: : </TBODY>
: : </TABLE>
: : </BODY>
: : </HTML>
: : </xsl:template>
: : If I build DOM tree by parsing XML file the resulting HTML
: : document after applying XSLT will display
: : Attribute Value
: : 00001 Value of Item 00001
: : 00002 Value of Item 00002
: : But if I build DOM tree using following code:
: : XMLDocument xDoc = new XMLDocument();
: : Element root = xDoc.createElement( "root" );
: : xDoc.appendChild( root );
: : Element elem = xDoc.createElement( "Item" );
: : elem.setAttribute( "ID", "00001" );
: : root.appendChild( elem ).
: : appendChild( xDoc.createTextNode( "Value of Item
00001" )
: : elem = xDoc.createElement( "Item" );
: : elem.setAttribute( "ID", "00002" );
: : root.appendChild( elem )
: : .appendChild( xDoc.createTextNode( "Value of Item
00002" )
: : the same XSLT will produce the following HTML output:
: : Attribute Value
: : Value of Item 00001
: : Value of Item 00002
: : So the value for the ID attribute is not displayed. At the
same
: : time I can access this attribute using DOM interface. For
: : example, following code
: : NodeList nList = xDoc.getElementsByTagName( "Item" );
: : Element e;
: : for( int i = 0; i < nList.getLength(); i++ )
: : e = (Element)nList.item( i );
: : System.out.println( "ID: " + e.getAttribute( "ID" ) );
: : produces an output
: : ID: 00001
: : ID: 00002
: : Here is the code for applying XSLT to DOM tree:
: : DOMParser parser = new DOMParser();
: : parser.parse( new FileInputStream( "test.xsl" ) );
: : XMLDocument xsldoc = parser.getDocument();
: : XSLStylesheet xsl = new XSLStylesheet( xsldoc, createURL
: : XMLDocument out = new XMLDocument();
: : out.appendChild( new XSLProcessor().processXSL(xsl, xDoc) );
: : out.print( new FileOutputStream( "test.html" ) );
: : Andrei Filimonov
null -
Sax Parser for loading XML file
We have a requirment by which we need to load huge XMl file in our DB everyday.
THe XML file format is like --
<?xml version="1.0" encoding="UTF-8"?>
<root>
<emp>
<ename>aaa</ename>
<sal>3000</sal>
</emp>
<emp>
<ename>bbb</ename>
<sal>5000</sal>
</emp>
<dept>
<name>productiong</name>
<location>USA</location>
<dept>
I have written XMl SAX parser to load this file into DB -
import org.xml.sax.helpers.DefaultHandler;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.XMLReader;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.Attributes;
import java.io.*;
import java.sql.*;
import oracle.jdbc.driver.*;
import oracle.xml.sql.*;
import oracle.sql.*;
import oracle.jdbc.*;
import oracle.jdbc.pool.OracleDataSource;
import java.util.*;
public class test extends DefaultHandler
String thisElement="";
String table_name="";
String table_name_2="";
String sql="";
String value_clause="";
StringBuffer value_clauseBuffer;
String Insert_sql="";
int flag;
String columnNames="";
String questionmarks="";
static String conStr = "jdbc:oracle:thin:@abcd1234:1521:dss501";
static Connection conn;
String arrayValues[] = new String[30];
int j = 0;
int emptyElementFlag = 0;
public SurveyReader() throws SQLException, FileNotFoundException, IOException{
DBConnect("username", "password");
public static void DBConnect(String username, String password)
throws SQLException, FileNotFoundException, IOException {
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection(conStr, username, password);
conn.setAutoCommit(true);
public void startElement(String namespaceURI, String localName,
String qName, Attributes atts) throws SAXException {
thisElement = qName;
if (thisElement!=table_name){
columnNames = columnNames + ", " + qName;
questionmarks = questionmarks +", " + "?";
emptyElementFlag =0;
public void characters(char[] ch, int start, int length)
throws SAXException {
if (thisElement !="root"){
if ((length == 0) && (thisElement !="") ){
table_name = thisElement;
sql = " Insert into "+ table_name +"(";
value_clause="";
value_clauseBuffer =null;
columnNames = "";
questionmarks ="";
j =0;
if ((length != 0) && (thisElement!="") && (thisElement!=table_name)){
emptyElementFlag = 1;
String s = new String(ch, start, length);
String newString = s.replaceAll("'", "''");
// String newString = s;
if (value_clauseBuffer== null){
value_clauseBuffer = new StringBuffer(newString);
else{
value_clauseBuffer.append(newString);
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
if (thisElement !="root"){
if ((!(value_clauseBuffer == null))||((emptyElementFlag ==0) && (qName !=table_name))) {
try{
//value_clauseBuffer.append("', '");
if (value_clauseBuffer == null){
arrayValues[j]="";
else{
arrayValues[j]=""+value_clauseBuffer;
j = j+1;
value_clauseBuffer = null;
emptyElementFlag =0;
}catch(Exception e){
System.err.println(e);
System.exit(2);
if (qName == table_name){
if (!(value_clauseBuffer == null)){
value_clause = "'"+value_clauseBuffer;
columnNames =columnNames.substring(1, columnNames.length());
int paramNumber = j;
questionmarks =questionmarks.substring(1, questionmarks.length());
sql = sql + columnNames + " ) values (" + questionmarks +"); ";
Insert_sql=Insert_sql + sql;
sql = "Begin "+sql + " End; ";
try{
PreparedStatement pstat = conn.prepareStatement(sql);
for (int i=0; i<=j-1; i++ ){
int k = i+1;
pstat.setObject(k, arrayValues);
ResultSet rset = pstat.executeQuery();
rset.close();
pstat.close();
catch (Exception e) {
System.err.println(e);
System.out.print("sql " + sql);
System.exit(1);
table_name_2 = table_name;
thisElement = "";
public static void main (String args[]) {
XMLReader xmlReader = null;
System.out.println("Time " + new java.util.Date());
try {
SAXParserFactory spfactory = SAXParserFactory.newInstance();
spfactory.setValidating(false);
SAXParser saxParser = spfactory.newSAXParser();
xmlReader = saxParser.getXMLReader();
xmlReader.setContentHandler(new SurveyReader());
xmlReader.setErrorHandler(new SurveyReader());
InputSource source = new InputSource("short.xml");
xmlReader.parse(source);
conn.close();
} catch (Exception e) {
System.err.println(e);
System.exit(1);
This parser takes 2 hours to laod file of size around 8MB.
ANy suggestions on improving performance of the parser.
ANy other approach I should be taking to load this file into DB.
We are using ORacle 9i DB with Character set UTF 8.
Thanks!String buf = (new String(ch, start, length)).trim();
if (thisElement != "root"){
if ((buf.length() == 0) && (thisElement !="") ){
It run ok!
Thanks 58871!
Now, i want to export oracle table to xml file like :
<?xml version="1.0" encoding="UTF-8"?>
<root>
<emp>
<ename>aaa</ename>
<sal>3000</sal>
</emp>
<emp>
<ename>bbb</ename>
<sal>5000</sal>
</emp>
</root>
Can SAX export to xml format?
Pham Thanh Tung -
XMLReader throws "Invalid UTF8 encoding." - Need parser for ISO-8859-1 chrs
Hi,
We are facing an issue when we try to send data which is encoded in "ISO-8859-1" charset (german chars) via the EMDClient (agent), which tries to parse it using the oracle.xml.parser.v2.XMLParser . The parser, while trying to read it, is unable to determine the charset encoding of our data and assumes that the encoding is "UTF-8", and when it tries to read it, throws the :
"java.io.UTFDataFormatException: Invalid UTF8 encoding." exception.
I looked at the XMLReader's code and found that it tries to read the first 4 bytes (Byte Order Mark - BOM) to determine the encoding. It is probably expecting us to send the data where the first line is probably:
<?xml version="1.0" encoding="iso88591" ?>
But, the data that our application sends is typically as below:
========================================================
# listener.ora Network Configuration File: /ade/vivsharm_emsa2/oracle/work/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = semsa2)
(ORACLE_HOME = /ade/vivsharm_emsa2/oracle)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = tcp)(HOST = stadm18.us.oracle.com)(PORT = 15100))
========================================================
the first 4 bytes in our case will be, int[] {35, 32, 108, 105} == chars {#, SPACE, l, i},
which does not match any of the encodings predefined in oracle.xml.parser.v2.XMLReader.pushXMLReader() method.
How do we ensure that the parser identifies the encoding properly and instantiates the correct parser for "ISO-8859-1"...
Should we just add the line <?xml version="1.0" encoding="iso88591" ?> at the beginning of our data?
We have tried constructing the inputstream (ByteArrayInputStream) by using String.getBytes("ISO-8859-1") and passing that to the parser, but that does not seem to work.
Please suggest.
Thanks & Regards,
Vivek.
PS: The exception we get is as below:
java.io.UTFDataFormatException: Invalid UTF8 encoding.
at oracle.xml.parser.v2.XMLUTF8Reader.checkUTF8Byte(XMLUTF8Reader.java:160)
at oracle.xml.parser.v2.XMLUTF8Reader.readUTF8Char(XMLUTF8Reader.java:187)
at oracle.xml.parser.v2.XMLUTF8Reader.fillBuffer(XMLUTF8Reader.java:120)
at oracle.xml.parser.v2.XMLByteReader.saveBuffer(XMLByteReader.java:450)
at oracle.xml.parser.v2.XMLReader.fillBuffer(XMLReader.java:2229)
at oracle.xml.parser.v2.XMLReader.tryRead(XMLReader.java:994)
at oracle.xml.parser.v2.XMLReader.scanXMLDecl(XMLReader.java:2788)
at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:502)
at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:205)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:180)
at org.xml.sax.helpers.ParserAdapter.parse(ParserAdapter.java:431)
at oracle.sysman.emSDK.emd.comm.RemoteOperationInputStream.readXML(RemoteOperationInputStream.java:363)
at oracle.sysman.emSDK.emd.comm.RemoteOperationInputStream.readHeader(RemoteOperationInputStream.java:195)
at oracle.sysman.emSDK.emd.comm.RemoteOperationInputStream.read(RemoteOperationInputStream.java:151)
at oracle.sysman.emSDK.emd.comm.EMDClient.remotePut(EMDClient.java:2075)
at oracle.sysman.emo.net.util.agent.Operation.saveFile(Operation.java:758)
at oracle.sysman.emo.net.common.WebIOHandler.saveFile(WebIOHandler.java:152)
at oracle.sysman.emo.net.common.BaseWebConfigContext.saveConfig(BaseWebConfigContext.java:505)Vivek
Your message is not XML. I believe that the XMLParser is going to have problems with that as well. Perhaps you could wrap the message in an XML tag set and begin the document as you suggested with <?xml version="1.0" encoding="iso88591"?>.
You are correct in that the parser uses only the first 4 bytes to detect the encoding of the document. It can only determine if the document in ASCII or EPCDIC based. If it is ASCII it can detect only between UTF-8 and UTF-16. It will need the encoding attribute to recognize the ISO-8859-1 encoding.
hope this helps
tom -
XML Parser for C++ v2 on HP-UX 11.00
Hi,
We are using XML parser for C++ v2(2.0.1) on HP-UX 11.00.Oracle version is 8.0.5. Our application is dumping core .analyzing the core gives pointers to Oracle function calls. We found that some datatypes in parser's oratypes.h (e.g ub4,sb4)were not in consistence with datatypes in native Oracle's oratypes.h.how to solve this problem? is there any linkage or Includepath order recommended to solve this? let me know if u know any solution/workaround
thanx in advance
vijayanand
nullWe're working on getting this fixed. Thanks for reporting it.
-
Loading XML parser for PL/SQL
I am working my way thru 'Building Oracle XML Applications' by Steve Muench.
I am getting a problem when I try to install the XML parser for PL/SQL
The following errors occur when I try to do
loadjava -v -r -u xmlbook/xmlbook xmlparserv2.jar
initialization complete
loading : oracle/xml/parser/v2/XMLByteReader
creating : oracle/xml/parser/v2/XMLByteReader
Error while creating class oracle/xml/parser/v2/XMLByteReader
ORA-29545: badly formed class: User has attempted to load a class (oracle.xml.parser.v2.XMLByteReader) into a restricted package. Permission can be granted using dbms_java.grant_permission(<user>, LoadClassInPackage...
loading : oracle/xml/parser/v2/PrintDriver
creating : oracle/xml/parser/v2/PrintDriver
Error while creating class oracle/xml/parser/v2/PrintDriver
ORA-29545: badly formed class: User has attempted to load a class (oracle.xml.parser.v2.PrintDriver) into a restricted package. Permission can be granted using dbms_java.grant_permission(<user>, LoadClassInPackage...
resolving: oracle/xml/parser/v2/PrintDriver
Error while resolving class oracle/xml/parser/v2/PrintDriver
ORA-04043: object /a065289c_PrintDriver does not exist
resolving: org/w3c/dom/html/HTMLAnchorElement
Error while resolving class org/w3c/dom/html/HTMLAnchorElement
ORA-04043: object /564607d_HTMLAnchorElement does not exist
About 20 classes get loaded correctly. All the rest get ORA-29545 or ORA-04043 errors.
I expect the ORA-04043 errors are a result of the earlier errors.
The documentation seems to indicate that there is no need to do
dbms_java.grant_permission to load into your own schema.
I have NT4 (sp6)
Oracle 8.1.7
xmlparserv2.jar dated 24/8/2001 17:01 size 1,177,259
xmlparserv2_2027.jar gives the same errors.
Any help would be appreciated.
nullWas it definitely xmlparsev2.jar that you had to load?
I recently started going through some of these examples as well and found that the standard xml parser was there but that I needed to load the xml parser for PL/SQL. I did this using loadjava from a subdirectory within the xdk directory and everything worked fine. -
Java +XML (SAX) Parser for Oracle 8.1.5 EE
Hi there :)
I am looking java classes for SAX to parse XML. I cannot find a valid parser, cause after downloaded from Oracle XDK for java, when i try to load this calasses i get a messages that i alot of classes connot be resolved.
If somebody have valid classes on Ora 8.1.5 please send me mail.
AdamHave i possibilities to using some javatypes in oracle java stored procedure if this class is not loaded into db?
Cause i would like to create a java stored procedure to parse and insert some data from xml. I was thinking to pass xml file name as a parameter to my java procedure.
I must use Oracle 8.1.5 with jdk 1.1.7, and the best parser for me is SAX.
Please help.
Have i possobilities to use class inside oracle, which are placed outside oracle?
Something like classpath, where can i modify value (but classpath inside oracle)? -
ANN: Oracle XML Parser for Java v2.0.0.1
A new maintenance release of the Oracle Parser for Java is
available for download. It has the following fixes and changes:
Bug fixes for #920536, i.e. Cannot access element attributes via
XSLT; #898423. i.e. ElementDecl's in DTDs; #774774, i.e. DOM
extensions using XSL pattern matching; #863890 i.e. SAX
IOException not thrown.
New APIs in the following new interface:
1. oracle.xml.parser.v2.NSResolver
- resolveNamespacePrefix( find the namespace definition in scope
for a given namespace prefix )
New APIs in the following classes:
1. oracle.xml.parser.v2.XMLNode
- selectNodes( Selects nodes from the tree which match the given
pattern; client can provide an NSResolver implementation to
resolve namespace prefixes in the pattern ).
2. oracle.xml.parser.v2.ElementDecl
- getParseTree( Returns the root Node of Content Model parse
tree, which could then be traversed node by node using
getFirstChild() and getLastChild(). The Node types are: PLUS,
COMMA, ASTERISK, ELEMENT, QMARK ).
This is the first beta patch release for v2.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
nullunzip -l appsborg2.zip | grep 9.0.4
0 04-18-03 20:10 .xdkjava_version_9.0.4.0.0_production
do i still need to do that step?No, you do not have to since "XML Parser for Java v9.0.4" is already installed as part of appsborg2.zip -
ANN: XML Parser for Java v2.0.2.6
The v2.0.2.6 of the XML Parser for Java is now available for download. The following features and bug fixes are included:
Changes:
Conformance to the XSLT/XPATH October REC.
New API in XSLStylesheet class:
removeParam(String param)
resetParams()
Bug fixes:
Bug #1111423: OutOfMemory exception, if multiple calls made to document()
Bug #1101028: Unexpected character error in DTD parsing document using Docbook DTD
Bug #1101021: #default not supported in exclude-result-prefixes
Bug #1099830: Extra characters inserted into output using the XML Parser
Bug #1099663: HTML output does not allow only doctype-public to be specified
Bug #1099536: HTML output does not disable escaping for script, style unless lowercase
Bug #1098738: ArrayOutOfBoundsException xsl:if test="not(@a)'"
Bug #1095047: XSLProcessor NPE'S on named templates with non-empty namespaces
Bug #1094971: XSLStylesheet needs methods for removing parameters
Bug #1092351: Using valueof() shuffles order of elements in my source document
Bug #1086663: xsl:sort data-type attribute can now be a namespace-prefixed name
Bug #1086661: xsl:version attribute now required on literal result element
Bug #1064692: Default xml-serialization should use empty-element syntax
Bug #1064689: Current() function doesn't work correctly
This is the sixth production patch release for v2.
Oracle XML Team http://technet.oracle.com
Oracle Technology Network
nullThe link has been fixed. You will go to the v2 download page
now. Sorry for the inconvience.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
Renilton Oliveira (guest) wrote:
: I didn't find the file for version 2.0.0.0 as well.
: Renilton
: Andrei Filimonov (guest) wrote:
: : I tried to download XML Parser for Java v2 it seems that
only
: v
: : 1.0.1.4 is available. Could you please give an exact URL for
: v2
: : download?
: : Andrei Filimonov
: : Oracle XML Team wrote:
: : : The Oracle XML v2 parser is now available for download
here
: as
: : : an early beta release and is written in Java. It features
: an
: : : improved architecture over the Oracle XML v1 parser and
has
: : : shown better performance on small to large XML documents.
: It
: : : will also be able to format the XML document according to
a
: : : stylesheet, having integrated an XSLT processor.
: : : Version 2 of the XML Parser for Java, besides
incorporating
: an
: : : XSLT processor, has been re-architected from version 1.
This
: : has
: : : resulted in a number of changes to the class names
: especially
: : : those that support Namespaces. See v2changes.txt and
: the .diff
: : : difference files in the sample directory.
: : : Oracle XML Team
: : : http://technet.oracle.com
: : : Oracle Technology Network
null -
ORACLE XML PARSER FOR JAVA FOR AIX
Hi people!
I'm looking for the Oracle XML Parser for Java 9.0.2.0.0C, my 9iAS is BI Installation 9.0.2.3, where can I get it? In the Downloads Section there is only the version for 10g, and the existing versions for 9i are not for AIX (my OS is AIX 5.2L).
Thanks.Thanks for your help, I navigate through this link and, even it shows a table where appears the release for AIX (9.2.0.6.0), when I get to http://www.oracle.com/technology/tech/xml/xdk/software/prod/utilsoft_java.htm
it shows me only downloads for Sun, Linux and HP-UX, but not for AIX.
Has the version for AIX being deprecated or something like that? -
XML parsing problems with Oracle XML parser for PL/SQL
I am using the Oracle XML parser for PL/SQL to transform XML into HTML usign XSL. The parser gives me sporadic errors trying to parse various XML documents. For the same XML source, the XMLPARSER will parse without errors one day and the next day will give me errors such as "invalid char in text", "Expected ';'.", or even Java null pointer exceptions.
I have verified that the XML sources are well formed, so I am pretty certain that the problems I am having are bugs in the XMLPARSER.
Is there going to be a XML parser for PL/SQL version 2 that will fix these bugs? If so, when??? If not, is there anything else I could do to fix these problems?
Thanks!You can use the latest version.
-
I want to implement the following C++ code in labview but i cannot make or loop to increase by two
int j = 0; for ( int i = 0; i < G_ReadLen; i = i + 2 ) {
BYTE AD_H = ByteArray.GetAt(i);
BYTE AD_L = ByteArray.GetAt(i + 1);
ValueArray[j] = AD_H << 8;
ValueArray[j] = ValueArray[j] + AD_L;unsigned long Temp = ValueArray[j] >> 12; Volts[j] = ((float)ValueArray[j]) * 0.0048875;Message.Format("%X , %X - %X, -- %d, +%.3f Volts", AD_H, AD_L, ValueArray[j], ValueArray[j], Volts[j]); m_output_ep1i.InsertString(0,Message);
j = j + 1;
Thanks
Solved!
Go to Solution.Your code will not work.
You are replacing elements of an empty array. A no-op in LabVIEW.
Besides there is a lot easier way to do this:
I just hope this is not a homework assignment.
And for completeness sake here is Mikes solution (seen below):
Ton
Message Edited by TonP on 11-14-2008 12:55 PM
Message Edited by TonP on 11-14-2008 01:03 PM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!
Attachments:
Read as U16.png 2 KB -
Oracle8.1.5 and XML parser for PL/SQL
Hi,
Does XML parser for PL/SQL work with Oracle 8.1.5? Did any one install the
same and if so what are steps to follow? I ran initjvm.sql to install
JServer and then tried to load jar files using loadjava, but it's giving
error. It's working fine with Oracle8.1.6.
Any idea?
Thanks,
Jayanta
null<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jayanta Ghosh ([email protected]):
Hi,
Does XML parser for PL/SQL work with Oracle 8.1.5? Did any one install the
same and if so what are steps to follow? I ran initjvm.sql to install
JServer and then tried to load jar files using loadjava, but it's giving
error. It's working fine with Oracle8.1.6.
Any idea?
Thanks,
Jayanta<HR></BLOCKQUOTE>
Oracle XML Parser has differents distributions for 8.1.5 and 8.1.6 databases, try the correct version, then runs the oraclexmlsqlload.csh from the lib directory of XSU distribution.
Best regards, Marcelo.
null -
2-byte error in XML Parser for PL/SQL
environment:
oracle 8.1.5
XML parser for Java 2.0.2.6.0
XML parser for PL/SQL 1.0.1.0.0
we use CLOB as xml data container, but it does not work properly with 2 byte chracter set.
I tested same situation except using VARCHAR2 instead of CLOB, it works without problem.
I think there is some bug in method parseClob of oracle.xml.parser.plsql.XMLParserCover about converting CLOB into String.
I appreciate any help to work around this problem.Hi,
We couldn't reproduce this error with our test case. Can you please post a test case that gives you this problem so we can assist you further?
Thank you,
Oracle XML Team -
XML-Parser for PL/SQL: OutOfMemoryError
When using the XML-Parser for transforming an
XML document into HTML, I sometimes get the
following error:
ORA-29516: Aurora assertion failure: Assertion failure at eox.c:187
Uncaught exception System error: java/lang/OutOfMemoryError
ORA-04030: out of process memory when trying to allocate 25509408 bytes (joxcx
callheap,ioc_allocate ufree)
The operation nevertheless seems to finish correctly. I run Oracle 8.1.6 under WinNT4
(384MB RAM) with a shared_pool_size of about
30MB and a java_pool_size of 40MB.
The original document is stored in a CLOB,
so I use xmlparser.parseClob to get it.
After the parsing is finished, the result is written to a file using xmldom.writeToFile.
Can anybody point me in the right direction?
Many thanks in advance!
Roman ([email protected])
nullMay I should have said that the memory error
occurs only when transforming a lot of xml documents at once using a cursor loop.
This is the procedure I use:
CREATE OR REPLACE procedure transformer is
p xmlparser.Parser;
q xmlparser.Parser;
xmldoc xmldom.DOMDocument;
xmldocnode xmldom.DOMNode;
proc xslprocessor.Processor;
ss xslprocessor.Stylesheet;
xsldoc xmldom.DOMDocument;
docfrag xmldom.DOMDocumentFragment;
docfragnode xmldom.DOMNode;
doc0 clob;
doc1 clob;
doc2 clob;
v_buffer long;
dir varchar2(100) := 'e:\grammis\html\parser';
xslfile varchar2(100) := 'detail.xsl';
errfile varchar2(100) := 'fehler.txt';
cursor c1 is select id from tb_infoknoten order by id desc;
begin
q := xmlparser.newParser;
-- parse xsl file
xmlparser.parse(q, dir | | '/' | | xslfile);
-- get document
xsldoc := xmlparser.getDocument(q);
-- make stylesheet
ss := xslprocessor.newStylesheet(xsldoc, dir | | '/' | | xslfile);
-- process xsl
proc := xslprocessor.newProcessor;
xslprocessor.showWarnings(proc, true);
xslprocessor.setErrorLog(proc, dir | | '/' | | errfile);
-- new parser
p := xmlparser.newParser;
-- set some characteristics
xmlparser.setValidationMode(p, FALSE);
xmlparser.setErrorLog(p, dir | | '/' | | errfile);
xmlparser.setPreserveWhiteSpace(p, TRUE);
xmlparser.setBaseDir(p, dir);
for h1 in c1 loop
select inhalt into doc2 from tb_infoknoten where id=h1.id;
DBMS_LOB.CREATETEMPORARY(doc0,TRUE, DBMS_LOB.SESSION);
v_buffer:='<?xml version="1.0" encoding="ISO-8859-1"?>';
dbms_lob.write(doc0,43,1,v_buffer);
DBMS_LOB.OPEN(doc0, DBMS_LOB.LOB_READWRITE);
DBMS_LOB.OPEN(doc2, DBMS_LOB.LOB_READONLY);
DBMS_LOB.COPY(doc0, doc2, DBMS_LOB.GETLENGTH(doc2), 44, 1);
DBMS_LOB.CLOSE(doc0);
DBMS_LOB.CLOSE(doc2);
xmlparser.parseClob(p, doc0);
DBMS_LOB.FREETEMPORARY(doc0);
-- get document
xmldoc := xmlparser.getDocument(p);
docfrag := xslprocessor.processXSL(proc, ss, xmldoc);
docfragnode := xmldom.makeNode(docfrag);
-- writing transformed document
xmldom.writeToFile(docfragnode, dir | | '/' | | h1.id | |'.html');
end loop;
end transformer;
null
Maybe you are looking for
-
I am new to mac book pro. Need to use for presentations - hooked up to LCD Projector. When connected, the projector only shows my wallpaper or a ppt slide show. What do I need to do to project other files or websites?
-
Apple TV country compatibility
My cousin intend to give me his Apple tv which he purchased it from USAand that I'm from Malaysia. Will the Apple TV work? Any comparability issues? Power supply socket
-
While every time i try to update my flash player plug-in, It save it but does not update it
I go to you tube to watch a video and Adobe Flash Player has crashed (send crash report) So when i do that it don't do anything but remain the same, so i update the plug-in and the computer saves it and it still says its not updated in the plug-in ch
-
Saving iChat IMs - what gets saved & where?
I was looking for information that I received in an IM this past week and when I went to look for the saved IMs - I could only find a few. I thought all IMs saved as default, or are only ones that I initiated saved? Or maybe I am looking in the wrong
-
NoClassDefFoundError found during runtime
My WdgUI class uses the wdg object an instantce of Wdg class. Both the classes have wdgPkg package name declared in the source code and the source code reside in c:\java\wdgPkg. Compilation is error free on Windows 2000 (using JDK 1.2.2 ver). WdgUI.c