XML output in java
I have a problem with my java program! I have a xml file that looks like this:
<command type="Hello">
<name id="Peter">
</name>
</command>
Now I want to get just the Hello and Peter out of the file. The other stuff I don't need. Haven't found anything jet which helps. Thanx Yogi
You can do it by using XML Api
refer to
http://java.sun.com/xml/tutorial_intro.html
or
www.developerlife.com
HIH!!
Similar Messages
-
Using RDF XML output with custom java concurrent program.
Hi, I started investigating the java API and did not find the way to use RDF XML output ? The goal is to use the Bursting engine to send out PDF generated from a "RDF XML" and a RTF template.
Is there someone that could help be with this ?
ThanksHi Jacky
Im looking to write a paper on this subject.
Basically you can write a java conc program that will take the XML output from the Oracle Report and burst it. So you could tackle it a couple of ways.
1. Have the JCP call the Oracle Report, sit and wait for it to complete then call the bursting engine with the XML and the control file. this has the advantage that its a single step for users to submit the report on the other hand you'll be writing a JCP specifically for that report.
2. Write a generic JCP that can burst any XML, a little tougher to write but will have applications all over the Apps suites.
Regards, Tim -
How to create a xml output in report 2.5
Hi
Please Anyone using reports 2.5 and trying to
implement XML outputsolutions ?? I have some
oracle reports that need to produce XML output
I know that 6i supports XML output. i dont know
how to do in 2.5. If anyone has done anything similar
to this, I'd be interested in hearing different solutions?
Thanks,
Parthi[ajayubbott],
I am not sure if you should create another folder to house all your servlets when using Java Web Server 2.0.
The servlet invoker of Java Web Server 2.0 looks at the <server_root directory>/servlets/ directory as the root servlet directory by default and any servlets that is housed under this directory is monitored by the custom class loader provided by Java Web Server 2.0.
This custom class loader will automatically reload any serlvet class files that are modified i.e. a newer version of the servlet that is newly compiled e.g. change in functionality. What this means is that you don't have restart the web server to reload any new version of the existing servlets on the web server.
HTH.
Allen Lai
Developer Technical Support
SUN Microsystems
http://www.sun.com/developers/support/ -
How to create a errortag in the XML-Output ?
Hey
who can help me creating a error-tag in my XML-output of a PL/SQL procedure ?
Enviroment:
Oracle DB is 8.1.7 with installed XDK-package (in a few
weeks perhaps Oracle 9i). I've no problems to use the dbms_xmlquery-functions and -procedures.
I've to develop a PL/SQL procedure which is called via JDBC from a JAVA program. The procedure execute a Select-Statement. The result is transformed in XML and stored in a CLOB, which is given back to the calling JAVA-program.
There exist 2 possible result-situations.
-1- one or more rows are found
-2- no row is found
Problem:
For each of these situation the XML-Output should have a different structure and my main problem is to integrate the errortag !!!
for -1-
<?xml version="1.0" encoding="ISO-8859-1"?>
<data>
<error err_code="NoError"/>
<record num="1">
</record>
<record num="2">
</record>
</data>
for -2-
<?xml version="1.0" encoding="ISO-8859-1"?>
<data>
<error err_code="NoDataFound"/>
</data>
Hope somebody can help me ???
AndreHey Rajat,
thanks for your answer, but the errortag is needed by another department. They use it for their processing.
Have you got any idea, how to integrate the errortag with the functions or procedures of the dbms_xmlquery package ??? I've got only a few days experience with the dbms_xmlquery-package, so some code examples or advices would be great !!!
I've tried the following coding:
out_xmlresult OUT CLOB; -- OUT Parameter of the PLSQL-Proc
c1 CLOB;
queryctx dbms_xmlquery.ctxtype;
-- create XML-context
queryctx:=dbms_xmlquery.newcontext(<selectstatement>);
-- delete the rowsettag (use 'data' later on)
dbms_xmlquery.setrowsettag(queryctx,'');
-- create new tag 'data' which enclose an empty header
-- and the data section
dbms_lob.createTemporary(c1, TRUE );
c1:=EMPTY_CLOB();
dbms_xmlquery.setDataHeader(queryctx,c1,'data');
-- rename rowtag
dbms_xmlquery.setrowtag(queryctx,'record');
-- set encoding tag
dbms_xmlquery.setEncodingTag(queryctx,'ISO-8859-1);
-- create XML-Output
out_xmlresult := dbms_xmlquery.getxml(queryctx);
...but I haven't got any success !!!
Andre -
Possible to change the xml output of the Inbound Interface?
Hi All,
I hav a scenarion where a third party system receives the XML from XI. the output of the xml from XI looks as follows:
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:Messages xmllns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
- <ns1:WMSItalyItemReplication xmlns:ns1="http://cpe.com/cpe_ftp_wms/ItemReplication">
- <item_dl dt_tm_created="2006-06-29 09:02:23">
- <item action="" owner_id="CIB" itm_num="3143832ZZ99">
<itm_desc>Ageflex ACM50 Test</itm_desc>
<unt_dol_val>1</unt_dol_val>
<lic_ctrl_flg>Y</lic_ctrl_flg>
<lot_ctrl_flg>Y</lot_ctrl_flg>
<shelf_life>999</shelf_life>
<product_life>999</product_life>
<incubate_prd>0</incubate_prd>
<hold_ord_flg>N</hold_ord_flg>
<kit_type>N</kit_type>
<prelabel_flg>N</prelabel_flg>
<rcv_only_flg>N</rcv_only_flg>
<convey_flg>N</convey_flg>
<front_flip_flg>N</front_flip_flg>
<pick_shp_bp>N</pick_shp_bp>
<side_flip_flg>N</side_flip_flg>
<rotate_flg>N</rotate_flg>
<itm_udef_a />
<itm_udef_b />
<itm_udef_c>Constant1</itm_udef_c>
<itm_udef_d />
<multi_conf_flg>N</multi_conf_flg>
</item>
</item_dl>
</ns1:WMSItalyItemReplication>
</ns0:Message1>
</ns0:Messages>
And the output that the third party expects is as follows:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE item_dl SYSTEM "http://localhost/dtd/item_dl.dtd">
<item_dl><item><itm_desc>Ageflex ACM50 Test</itm_desc>
<unt_dol_val>1</unt_dol_val>
<lic_ctrl_flg>Y</lic_ctrl_flg>
<lot_ctrl_flg>Y</lot_ctrl_flg>
<shelf_life>999</shelf_life>
<product_life>999</product_life>
<incubate_prd>0</incubate_prd>
<hold_ord_flg>N</hold_ord_flg>
<kit_type>N</kit_type>
<prelabel_flg>N</prelabel_flg>
<rcv_only_flg>N</rcv_only_flg>
<convey_flg>N</convey_flg>
<front_flip_flg>N</front_flip_flg>
<pick_shp_bp>N</pick_shp_bp>
<side_flip_flg>N</side_flip_flg>
<rotate_flg>N</rotate_flg>
<itm_udef_a></itm_udef_a>
<itm_udef_b></itm_udef_b>
<itm_udef_c>Constant1</itm_udef_c>
<itm_udef_d></itm_udef_d>
<multi_conf_flg>N</multi_conf_flg>
</item>
</item_dl>
Observe the first two lines of the second output.
I tried to generate the second xml using a java mapping. and it is working fine when i test it in the Interface mapping's test tab. but it is not working when i test the scenario end to end. It is giving some runtime error.
is it possible to change the namespace, etc in the output of the XML coming out of XI? if v change those namespace stuff, does XI recongnise the message and send it to the appropriate reciever?
Please suggest me any solution.
any help wud b greatly appreciated.The first XML is a Split msg XML..Where there are multiple messages within a single XML document..Thats why u have a <ns0:Messages xmllns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
Tags..
Recheck what ur target system needs are & change ur mapping in XI. -
Reading an XML file and write the contents to another xml file in java
Hi,
I am new to xml parsing.My requirement is that I am getting a message (xml) using ibm MQ in the ByteArrayInputStream format.I have to read this xml message and write to another file.
I am creating a POC for this.
First I used simple reading and writing concept but the output is "java.io.FileInputStream@3e25a5 "
Sample xml file
- <Client>
<ClientId>1234</ClientId>
<ClientName>STechnology</ClientName>
<DTU_ID>567</DTU_ID>
<ClientStatus>ACTIVE</ClientStatus>
- <LEAccount>
<ClientLE>678989</ClientLE>
<LEId>56743</LEId>
- <Account>
<AccountNumber>9876543678</AccountNumber>
</Account>
</LEAccount>
- <Service>
<Cindicator>Y2Y</Cindicator>
<PrefCode>980</PrefCode>
<BSCode>876</BSCode>
<MandatoryContent>MSP</MandatoryContent>
</Service>
</Client>
code:
import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
public class ByteArrayInputStreamToXml {
public static void main(String srg[]) throws IOException{
InputStream inputStream= new FileInputStream("C:\\soft\\test2\\sample1.xml");
byte currentXMLBytes[] = inputStream.toString().getBytes();
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(currentXMLBytes);
OutputStream out = new FileOutputStream("C:\\soft\\test\\data.xml");
int read=0;
byte[] bytes = new byte[1024];
while((read = byteArrayInputStream.read(bytes))!= -1){
out.write(bytes, 0, read);
out.write( '\n' );
inputStream.close();
out.flush();
out.close();
System.out.println("New file created!");
Please suggest me how can I use DOM/SAX parser ,I can see several code on net for reading xml file using SAX/DOM parser but writing an xml file after reading it using ByteArrayInputStream I am not getting .A help through some example Link will also be helpful for me.
Thanks
Sumit
Edited by: user8687839 on Apr 30, 2012 2:37 AM
Edited by: user8687839 on Apr 30, 2012 2:43 AMThanks I got the result.
package com.sumit.collections;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
public class ByteArrayInputStreamToXml {
public static void main(String srg[]) throws IOException{
InputStream inputStream= new FileInputStream("C:\\soft\\test2\\sample1.xml");
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead; byte[] data = new byte[1024];
while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, nRead); } buffer.flush();
byte currentXMLBytes[]= buffer.toByteArray();
/* byte currentXMLBytes[] = inputStream.toString().getBytes();*/
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(currentXMLBytes);
OutputStream out = new FileOutputStream("C:\\soft\\test\\data.xml");
int read=0;
byte[] bytes = new byte[1024];
while((read = byteArrayInputStream.read(bytes))!= -1){
out.write(bytes, 0, read);
out.write( '\n' );
inputStream.close();
out.flush();
out.close();
System.out.println("New file created!");
} -
Hi all i am working to create a XML file using java can any one show me some sample code how to do so
All I suggested was to insert a single line ("X.serialize(root);") into your code. Anyway, here's a ready-to-compile source code based on yours. This code utilizes the Xerces-J class library.import java.io.File;
import java.io.FileWriter;
import org.apache.xerces.dom.DocumentImpl;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
import org.w3c.dom.Element;
public class Test {
public static void main(String[] arguments) {
FileWriter out;
DocumentImpl d;
Element root;
XMLSerializer X;
try {
System.out.println(" creatin ");
File fos = new File("xsr.xml");
out = new FileWriter("xsr.xml");
System.out.println("created File .." + fos.getName());
out.flush();
d = new DocumentImpl();
System.out.println("create root");
root = d.createElement("abc");
System.out.println("creating element");
d.insertBefore(root, null);
//out.write(d.createAttribute(""));
OutputFormat o = new OutputFormat(d);
System.out.println("Output format...");
o.setIndent(5);
o.setIndenting(true);
o.setDoctype("lab1.dtd", "lab1.dtd");
o.setDoctype("name of dtd file", "name of dtd file");
X = new XMLSerializer(o);
X.setOutputCharStream(out);
X.serialize(root);
out.flush();
out.close();
catch (Exception e1){
e1.printStackTrace();
} -
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 -
How to write as XML file using java 1.5
hi all,
i am trying to create an XML file using java 1.5. I took a XML creating java file which was working with java 1.4 and ported same file into java 1.5 with changes according to the SAX and DOM implmentation in java 1.5 and tried to compile. But while writing as a file it throws error "cannot find the symbol."
can any body help me out to solve this issue.......
thankx in advance
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.NamedNodeMap;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.DocumentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.helpers.ParserFactory;
import java.io.*;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document xmlDoc = db.newDocument();
// this creates the xml document ref
// parent node reference
Element rootnd = (Element) xmlDoc.createElement("ALL_TABLES");
// root node
xmlDoc.appendChild(rootnd);
Element rownd = (Element) xmlDoc.createElement("ROW");
rootnd.appendChild(rownd);
Element statusnd = (Element) xmlDoc.createElement("FILE_STATUS");
rownd.appendChild(statusnd);
statusnd.appendChild(xmlDoc.createTextNode("Y")
FileOutputStream outpt = new FileOutputStream(outdir + "//forbranch.xml");
Writer outf = new OutputStreamWriter(outpt, "UTF-8");
//error is occuring here Since write method is not available in the Document class
xmlDoc.write(outf);
outf.flush();Hi,
when I look in the JDK1.4.2 specification I don't see any write method in the Document interface.
However, your solution is the Transformer class. There you transform your DOM tree into any output you need. Your code sould look something like this: TransformerFactory tf = TransformerFactory.newInstance();
// set all necessary features for your transformer -> see OutputKeys
Transformer t = tf.newTransformer();
t.transform(new DOMSource(xmlDoc), new StreamResult(file));Then you have your XML file stored in the file system.
Hope it helps. -
Wrong XML parsing in Java 6.0 , the same code works fine with Java 5.0
I have the following xml data in a file ( C:\_rf\jrebug.xml ) :
<?xml version="1.0" encoding="UTF-8"?>
<rs>
<data
input3='aa[1]'
input4='bb[1]'
input6='cc[2]'
input8='dd[7]'
output2='ee[7]'
output4='ff[511]'
output6='gg[15]'
output7='hh[1]'
/>
</rs>
I have the following code to parse this XML data :
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXParseException;
public class DomParserBug {
Document dom;
public void runExample() {
parseXmlFile("C:\\_rf\\jrebug.xml");
parseDocument();
private void parseXmlFile(String filename){
//get the factory
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
//dbf.setValidating(true);
dbf.setValidating(false);
try {
//Using factory get an instance of document builder
DocumentBuilder db = dbf.newDocumentBuilder();
db.setErrorHandler(new MyErrorHandler());
//parse using builder to get DOM representation of the XML file
dom = db.parse(filename);
}catch(ParserConfigurationException pce) {
pce.printStackTrace();
catch(SAXParseException spe) {
spe.printStackTrace();
catch(IOException ioe) {
ioe.printStackTrace();
catch(SAXException se) {
se.printStackTrace();
private void parseDocument()
Element docEle = dom.getDocumentElement();
NodeList nl = docEle.getElementsByTagName("data");
if(nl != null && nl.getLength() > 0)
for(int i = 0 ; i < nl.getLength();i++)
Element el = (Element)nl.item(i);
NamedNodeMap attrsssss = el.getAttributes();
for (int ii=0; ii<attrsssss.getLength(); ++ii)
Node attr = attrsssss.item(ii);
System.out.println("Attribute name is =" attr.getNodeName() " AND Attribute value is ="+attr.getNodeValue());
public static void main(String[] args){
DomParserBug dpe = new DomParserBug();
dpe.runExample();
class MyErrorHandler implements ErrorHandler {
public void error(SAXParseException e) {
System.out.println("error : " +e.toString());
// This method is called in the event of a non-recoverable error
public void fatalError(SAXParseException e) {
System.out.println("fatalError : " +e.toString());
// This method is called in the event of a warning
public void warning(SAXParseException e) {
System.out.println("warning : " +e.toString());
The parsed output is :
Attribute name is =input3 AND Attribute value is =aa[1]
Attribute name is =input4 AND Attribute value is =bb[1]
Attribute name is =input6 AND Attribute value is =cc[2]
Attribute name is =input8 AND Attribute value is =dd[7]
Attribute name is =output2 AND Attribute value is =ee[7]
Attribute name is =output4 AND Attribute value is =ff[511]
Attribute name is =output6 AND Attribute value is =hh[1]]
Attribute name is =output7 AND Attribute value is =hh[1]
THE LAST TWO LINES ARE SIMPLY WRONG.
With java 5.0 the last two lines are parsed correctly :
Attribute name is =output6 AND Attribute value is =gg[15]
Attribute name is =output7 AND Attribute value is =hh[1]
I have seen this issue only after I upgraded to java 6.0. I have searched the java 6.0 bug database but there is nothing there.
I have also submitted a bug to the bugdatabase last month but have not heared anything.
Anybody have any clue about this ???
Thanks
Edited by: skaushik on Jan 4, 2008 12:40 AM
Edited by: skaushik on Jan 4, 2008 6:38 PMI have seen similar issue. I found that if you remove the square brackets from the first line in teh XML file, the last two lines are parsed correctly.
Replace the follwing line : :
Attribute name is =input3 AND Attribute value is =aa[1]
with :
Attribute name is =input3 AND Attribute value is =aa
and the output is CORRECT :
Attribute name is =input3 AND Attribute value is =aa
Attribute name is =input4 AND Attribute value is =bb[1]
Attribute name is =input6 AND Attribute value is =cc[2]
Attribute name is =input8 AND Attribute value is =dd[7]
Attribute name is =output2 AND Attribute value is =ee[7]
Attribute name is =output4 AND Attribute value is =ff[511]
Attribute name is =output6 AND Attribute value is =gg[15]
Attribute name is =output7 AND Attribute value is =hh[1] -
All -
I'm new to consuming web services in JDeveloper. I'm using Oracle JDEV 10.1.3.3/OC4J. I'm using this version since it is compatible with Oracle EBS 12.1.3. My intent is to pull data from our third party recruitment app (Success Factors) and load that data into Oracle HRIS. I'm already doing this through a .NET application. I'm converting it to be a Java Concurrent Program in EBS. The code listed below is a stub call to verify I'm on the right track. I created a JDeveloper Web Services proxy project. I'm testing it locally on my windows desktop. When I'm able to consume the service successfully, then I'll think about moving it to the EBS server.
I'm getting the following error when I invoke the following service:
HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
End point is: https://api4.successfactors.com/sfapi/v1/soap?wsdl
Any help/assistance would be much appreciated.
Below is my code and output of my test:
package emsc.oracle.apps.emscper.sfapi.proxy;
import HTTPClient.HTTPConnection;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.IsValidSession;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.IsValidSessionResponse;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Login;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LoginResponse;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LoginResult;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Logout;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LogoutResponse;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.SFCredential;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.SFParameter;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Error;
import java.io.File;
import javax.xml.rpc.ServiceFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.Date;
import javax.xml.ws.BindingProvider;
import javax.xml.soap.SOAPException;
import java.util.Map;
import oracle.security.ssl.OracleSSLCredential;
public class SFAPITest {
// Declare members:
private String companyId;
private String userName;
private String password;
private String developerKey;
private Date effDt;
private String greaterThanEffDt;
private String lessThanEffDt;
// Declare constants:
final static private String breakLine = "+---------------------------------------------------------------------------+";
final static private String format = "yyyy-mm-dd";
private enum ReqId {
PrimaryReq(25),
PrimaryReqCEO(26),
EmCarePrimary(27),
RTI(28),
EmCareClinical(29);
private int reqId;
private ReqId() {
private ReqId(int value) {
reqId = value;
public int getReqId() {
return reqId;
// Getters and Setters:
protected String getCompanyId() {
return this.companyId;
protected void setCompanyId(String value) {
this.companyId = value;
protected String getUserName() {
return this.userName;
protected void setUserName(String value) {
this.userName = value;
protected String getPassword() {
return this.password;
protected void setPassword(String value) {
this.password = value;
protected String getDeveloperKey() {
return this.developerKey;
protected void setDeveloperKey(String value) {
this.developerKey = value;
protected Date getEffDt() {
return this.effDt;
protected void setEffDt(Date value) {
this.effDt = value;
protected String getGreaterThanEffDt() {
return this.greaterThanEffDt;
protected void setGreaterThanEffDt(String value) {
this.greaterThanEffDt = value;
protected String getLessThanEffDt() {
return this.lessThanEffDt;
protected void setLessThanEffDt(String value) {
this.lessThanEffDt = value;
public void runProgram()
SFAPIService mySFAPIService;
String CompletionText = "";
String effDtStr2 = null;
/* Code your program logic here.
* Use getJDBCConnection method to get the connection object for any
* JDBC operations.
* Use CpContext provided commit,rollback methods to commit/rollback
* data base transactions.
* Don't forget to release the connection before returning from this
* method.
/* Call setCompletion method to set the request completion status and
* completion text.
* Status values are ReqCompletion.NORMAL,ReqCompletion.WARNING,
* ReqCompletion.ERROR.
* Use Completion text message of length 240 characters. If it is more
* than 240 then full string will appear in log file and truncated 240
* characters will be used as request completion text.
try
ServiceFactory factory = ServiceFactory.newInstance();
mySFAPIService = (emsc.oracle.apps.emscper.sfapi.proxy.SFAPIService)factory.loadService(emsc.oracle.apps.emscper.sfapi.proxy.SFAPIService.class);
SFAPI api = mySFAPIService.getSFAPI();
/// SFAPI api = new SFAPI();
//Map<String, Object> requestContext = ((BindingProvider) api).getRequestContext();
//requestContext.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
System.out.println("ServiceName => " + mySFAPIService.getServiceName().toString());
System.out.println("End Point => " + mySFAPIService.getServiceName().toString());
System.out.println(breakLine);
// Authentication: Login to SFAPI:
SFCredential credential = new SFCredential();
// Fake credentials being passed in for this post:
credential.setCompanyId("XXX");
credential.setUsername("XXX");
credential.setPassword("XXX");
credential.setDeveloperKey("XXX");
HTTPConnection httpsConnection = null;
OracleSSLCredential _credential = new OracleSSLCredential();
_credential.setWallet("\\\\\\C:\\Program Files\\Java\\jdk1.6.0_33\\jre\\lib\\security", "ParkEstes3");
/*System.setProperty("javax.net.ssl.trustStore","C:\\\\\OraHome_1\\jdev\\jdevbin\\jdk\\jre\\lib\\security\\keystore");
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
System.out.println(System.getProperty("javax.net.ssl.trustStore"));*/
// SFParameter: Define a generic SFParameter List. This is a necessary parameter
// to invoking calls in SFAPI:
/*System.setProperty("javax.net.ssl.keyStore",
"file:\\\C:\\jdk1.4.1\\jre\\lib\\security\\client.keystore");
System.setProperty("javax.net.ssl.keyStorePassword","welcome"); */
/* System.setProperty("oracle.net.wallet_location",
"(SOURCE=(METHOD=file)(METHOD_DATA=(DIRECTORY=\\\C:\Users\dparrish\Oracle\WALLETS)))"); // (2) */
File kstore = new File("C:\\OraHome_1\\jdev\\jdevbin\\jdk\\jre\\lib\\security\\jssecacerts");
boolean exists = kstore.exists();
if (!exists) {
System.out.println("Keystore does not exist");
else {
System.out.println("Keystore does exist");
System.setProperty("javax.net.ssl.trustStore", kstore.getAbsolutePath());
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
//System.setProperty("proxySet", "false");
//System.setProperty("http.proxyHost", "127.0.0.1");
//System.setProperty("http.proxyPort", "8080");
System.out.println(kstore.getAbsolutePath());
List<SFParameter> lst = new ArrayList<SFParameter>();
SFParameter param = new SFParameter();
param.setName("");
param.setValue("");
lst.add(param);
SFParameter[] sfParam = lst.toArray(new SFParameter[lst.size()]);
Login login = new Login();
try {
login.setCredential(credential);
System.out.println("1");
login.setParam(sfParam);
System.out.println("2");
LoginResponse loginResponse = new LoginResponse();
LoginResult loginResult = new LoginResult();
try {
loginResponse = api.login(login);
catch (Exception e ) {
System.out.println(e.getMessage());
System.out.println("3");
try {
loginResult = loginResponse.getResult();
catch (Exception e ) {
System.out.println(e.getMessage());
System.out.println("4");
IsValidSession vs = new IsValidSession();
IsValidSessionResponse isValidSessionResponse = api.isValidSession(vs);
System.out.println("5");
if (isValidSessionResponse.isResult()) {
System.out.println("Session is valid");
System.out.println("Result => " + loginResult.getSessionId());
System.out.println(breakLine);
Logout logout = new Logout();
LogoutResponse logoutResponse = api.logout(logout);
if (logoutResponse.isResult()) {
System.out.println("Logout of SFAPI Successful");
else {
System.out.println("Logout of SFAPI Unsuccessful");
else {
System.out.println("Session is invalid");
List<Error> errors = new ArrayList<Error>();
for (int i = 0; i < loginResult.getError().length; i++) {
errors.add(loginResult.getError()[i]);
for (int i = 0; i < errors.size(); i++) {
System.out.println("Error Indice => " + i);
System.out.println("Error Code: => " + errors.get(i).getErrorCode());
System.out.println("Error Message: => " + errors.get(i).getErrorMessage());
System.out.println(breakLine);
} // end for loop of SFObject errors
} // end InvalidSession
catch (Exception e)
System.out.println("Session Credential Exception");
System.out.println("Exception => " + e.getMessage());
System.out.println(breakLine);
catch (Exception e)
System.out.println("Parameter List Exception");
System.out.println("Exception => " + e.getMessage());
System.out.println(breakLine);
} // end runProgram
// Constructor:
public SFAPITest() {
} // end constructor
public static void main (String args[]) {
try
SFAPITest test = new SFAPITest();
test.runProgram();
catch (Exception e) {
System.out.println("main exception => " + e.getMessage());
} // SFAPITest
Here is the output with trace:
WARNING: Unable to connect to URL: https://api4.successfactors.com:443/sfapi/v1/soap due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
Session Credential Exception
Exception => ; nested exception is:
HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
+---------------------------------------------------------------------------+
Process exited with exit code 0.The other end is throwing back a programming error.
That might be because you are sending incorrect data and the other end fails to validate it.
You might be able to guess based on your C# code. But, since you are using soap one generic solution is available to you.
- Get an http proxy interceptor like wireshark.
- Run it while your C# app runs, collect the http requests from that.
- Run it while running your java code, collect the http requests from that.
Compare the two. -
XML Report is generating xml output instead of pdf output
Hi All,
I have created a report using BI publisher.When I am runnng the report it is showing xml output instaead of pdf format...The report is getting completed with a warning message.I am able to see other reports (XML) outputs in pdf format.But this report is having some problem ,which i am not able to identify.
Please help..
Thanks,
JoohiOutput of OPP log file
[5/17/12 5:35:11 PM] [main] Starting GSF service with concurrent process id = 457384.
[5/17/12 5:35:11 PM] [main] Initialization Parameters: oracle.apps.fnd.cp.opp.OPPServiceThread:2:0:max_threads=5
[5/17/12 5:35:11 PM] [Thread-32] Service thread starting up.
[5/17/12 5:35:11 PM] [Thread-33] Service thread starting up.
[5/17/12 5:47:20 PM] [OPPServiceThread0] Post-processing request 33169846.
[5/17/12 5:47:21 PM] [457384:RT33169846] Executing post-processing actions for request 33169846.
[5/17/12 5:47:21 PM] [457384:RT33169846] Starting XML Publisher post-processing action.
[5/17/12 5:47:21 PM] [457384:RT33169846]
Template code: XXMI_MILEAGE_ALLOWANCE
Template app: XXMI
Language: en
Territory: 00
Output type: PDF
[051712_054721299][][EXCEPTION] [DEBUG] ------- Preferences defined PreferenceStore -------
[051712_054721299][][EXCEPTION] [DEBUG] ------- Environment variables stored in EnvironmentStore -------
[051712_054721299][][EXCEPTION] [DEBUG] [FND_JDBC_IDLE_THRESHOLD.LOW]:[-1]
[051712_054721299][][EXCEPTION] [DEBUG] [SECURITY_GROUP_ID]:[0]
[051712_054721299][][EXCEPTION] [DEBUG] [FND_JDBC_BUFFER_DECAY_INTERVAL]:[300]
[051712_054721299][][EXCEPTION] [DEBUG] [NLS_CHARACTERSET]:[AL32UTF8]
[051712_054721300][][EXCEPTION] [DEBUG] [RESP_APPL_ID]:[-1]
[051712_054721300][][EXCEPTION] [DEBUG] [NLS_LANGUAGE]:[AMERICAN]
[051712_054721300][][EXCEPTION] [DEBUG] [FND_JDBC_BUFFER_MIN]:[1]
[051712_054721300][][EXCEPTION] [DEBUG] [FND_JDBC_BUFFER_MAX]:[2]
[051712_054721300][][EXCEPTION] [DEBUG] [NLS_NUMERIC_CHARACTERS]:[.,]
[051712_054721300][][EXCEPTION] [DEBUG] [APPS_JDBC_URL]:[jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=YES)(FAILOVER=YES)(ADDRESS=(PROTOCOL=tcp)(HOST=ffebdbs04.datahost.int)(PORT=1611)))(CONNECT_DATA=(SID=MFDEV)))]
[051712_054721300][][EXCEPTION] [DEBUG] [RESP_ID]:[-1]
[051712_054721300][][EXCEPTION] [DEBUG] [FND_MAX_JDBC_CONNECTIONS]:[500]
[051712_054721300][][EXCEPTION] [DEBUG] [FND_JDBC_USABLE_CHECK]:[false]
[051712_054721300][][EXCEPTION] [DEBUG] [USER_ID]:[-1]
[051712_054721300][][EXCEPTION] [DEBUG] [NLS_TERRITORY]:[AMERICA]
[051712_054721300][][EXCEPTION] [DEBUG] [FND_JDBC_PLSQL_RESET]:[false]
[051712_054721300][][EXCEPTION] [DEBUG] [FND_JDBC_CONTEXT_CHECK]:[true]
[051712_054721300][][EXCEPTION] [DEBUG] [NLS_DATE_FORMAT]:[DD-MON-RR]
[051712_054721300][][EXCEPTION] [DEBUG] [FND_JDBC_BUFFER_DECAY_SIZE]:[5]
[051712_054721301][][EXCEPTION] [DEBUG] [FND_JDBC_IDLE_THRESHOLD.HIGH]:[-1]
[051712_054721301][][EXCEPTION] [DEBUG] [NLS_SORT]:[BINARY]
[051712_054721301][][EXCEPTION] [DEBUG] [NLS_DATE_LANGUAGE]:[AMERICAN]
[051712_054721301][][EXCEPTION] [DEBUG] [LOGIN_ID]:[-1]
[051712_054721301][][EXCEPTION] [DEBUG] ------- Properties stored in Java System Properties -------
[051712_054721301][][EXCEPTION] [DEBUG] [APPLTMP]:[u02/erp/mfdevAPP/inst/apps/MFDEV_ffebapp04/appltmp]
[051712_054721301][][EXCEPTION] [DEBUG] [java.runtime.name]:[Java(TM) SE Runtime Environment]
[051712_054721301][][EXCEPTION] [DEBUG] [sun.boot.library.path]:[u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/i386]
[051712_054721301][][EXCEPTION] [DEBUG] [java.vm.version]:[16.0-b13]
[051712_054721301][][EXCEPTION] [DEBUG] [OVERRIDE_DBC]:[true]
[051712_054721301][][EXCEPTION] [DEBUG] [dbcfile]:[u02/erp/mfdevAPP/inst/apps/MFDEV_ffebapp04/appl/fnd/12.0.0/secure/MFDEV.dbc]
[051712_054721301][][EXCEPTION] [DEBUG] [java.vm.vendor]:[Sun Microsystems Inc.]
[051712_054721301][][EXCEPTION] [DEBUG] [java.vendor.url]:[http://java.sun.com/]
[051712_054721301][][EXCEPTION] [DEBUG] [path.separator]:[:]
[051712_054721301][][EXCEPTION] [DEBUG] [APPLCSF]:[u02/erp/mfdevAPP/inst/apps/MFDEV_ffebapp04/logs/appl/conc]
[051712_054721301][][EXCEPTION] [DEBUG] [java.vm.name]:[Java HotSpot(TM) Server VM]
[051712_054721302][][EXCEPTION] [DEBUG] [file.encoding.pkg]:[sun.io]
[051712_054721302][][EXCEPTION] [DEBUG] [sun.java.launcher]:[SUN_STANDARD]
[051712_054721302][][EXCEPTION] [DEBUG] [user.country]:[US]
[051712_054721302][][EXCEPTION] [DEBUG] [sun.os.patch.level]:[unknown]
[051712_054721302][][EXCEPTION] [DEBUG] [java.vm.specification.name]:[Java Virtual Machine Specification]
[051712_054721302][][EXCEPTION] [DEBUG] [user.dir]:[u02/erp/mfdevAPP/inst/apps/MFDEV_ffebapp04/logs/appl/conc/log]
[051712_054721302][][EXCEPTION] [DEBUG] [java.runtime.version]:[1.6.0_18-b07]
[051712_054721302][][EXCEPTION] [DEBUG] [CLIENT_PROCESSID]:[30695]
[051712_054721302][][EXCEPTION] [DEBUG] [java.awt.graphicsenv]:[sun.awt.X11GraphicsEnvironment]
[051712_054721302][][EXCEPTION] [DEBUG] [java.endorsed.dirs]:[u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/endorsed]
[051712_054721302][][EXCEPTION] [DEBUG] [os.arch]:[i386]
[051712_054721302][][EXCEPTION] [DEBUG] [JTFDBCFILE]:[u02/erp/mfdevAPP/inst/apps/MFDEV_ffebapp04/appl/fnd/12.0.0/secure/MFDEV.dbc]
[051712_054721302][][EXCEPTION] [DEBUG] [java.io.tmpdir]:[tmp]
[051712_054721302][][EXCEPTION] [DEBUG] [line.separator]:[
[051712_054721303][][EXCEPTION] [DEBUG] [java.vm.specification.vendor]:[Sun Microsystems Inc.]
[051712_054721303][][EXCEPTION] [DEBUG] [os.name]:[Linux]
[051712_054721303][][EXCEPTION] [DEBUG] [FND_JDBC_BUFFER_MIN]:[1]
[051712_054721303][][EXCEPTION] [DEBUG] [cpid]:[457384]
[051712_054721303][][EXCEPTION] [DEBUG] [sun.jnu.encoding]:[UTF-8]
[051712_054721303][][EXCEPTION] [DEBUG] [oracle.apps.fnd.common.Pool.leak.mode]:[stderr:off]
[051712_054721303][][EXCEPTION] [DEBUG] [java.library.path]:[u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/i386/server:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/i386:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/../lib/i386:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/lib32:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/lib:/u02/erp/mfdevAPP/apps/apps_st/appl/cz/12.0.0/bin:/u02/erp/mfdevAPP/apps/apps_st/appl/iby/12.0.0/bin:/u02/erp/mfdevAPP/apps/apps_st/appl/pon/12.0.0/bin:/u02/erp/mfdevAPP/apps/apps_st/appl/sht/12.0.0/lib:/usr/java/packages/lib/i386:/lib:/usr/lib]
[051712_054721303][][EXCEPTION] [DEBUG] [java.specification.name]:[Java Platform API Specification]
[051712_054721303][][EXCEPTION] [DEBUG] [java.class.version]:[50.0]
[051712_054721303][][EXCEPTION] [DEBUG] [sun.management.compiler]:[HotSpot Tiered Compilers]
[051712_054721303][][EXCEPTION] [DEBUG] [queue_appl_id]:[0]
[051712_054721303][][EXCEPTION] [DEBUG] [os.version]:[2.6.18-238.12.1.0.1.el5]
[051712_054721303][][EXCEPTION] [DEBUG] [LONG_RUNNING_JVM]:[true]
[051712_054721303][][EXCEPTION] [DEBUG] [user.home]:[home/appmfdev]
[051712_054721304][][EXCEPTION] [DEBUG] [user.timezone]:[Europe/Berlin]
[051712_054721304][][EXCEPTION] [DEBUG] [java.awt.printerjob]:[sun.print.PSPrinterJob]
[051712_054721304][][EXCEPTION] [DEBUG] [file.encoding]:[UTF-8]
[051712_054721304][][EXCEPTION] [DEBUG] [java.specification.version]:[1.6]
[051712_054721304][][EXCEPTION] [DEBUG] [CACHEMODE]:[DISTRIBUTED]
[051712_054721304][][EXCEPTION] [DEBUG] [conc_queue_id]:[6269]
[051712_054721304][][EXCEPTION] [DEBUG] [java.class.path]:[u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/lib/dt.jar:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/lib/tools.jar:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/rt.jar:/u02/erp/mfdevAPP/apps/apps_st/comn/java/lib/appsborg2.zip:/u02/erp/mfdevAPP/apps/apps_st/comn/java/classes]
[051712_054721304][][EXCEPTION] [DEBUG] [user.name]:[appmfdev]
[051712_054721304][][EXCEPTION] [DEBUG] [DBCFILE]:[u02/erp/mfdevAPP/inst/apps/MFDEV_ffebapp04/appl/fnd/12.0.0/secure/MFDEV.dbc]
[051712_054721304][][EXCEPTION] [DEBUG] [java.vm.specification.version]:[1.0]
[051712_054721304][][EXCEPTION] [DEBUG] [java.home]:[u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre]
[051712_054721304][][EXCEPTION] [DEBUG] [sun.arch.data.model]:[32]
[051712_054721304][][EXCEPTION] [DEBUG] [user.language]:[en]
[051712_054721304][][EXCEPTION] [DEBUG] [java.specification.vendor]:[Sun Microsystems Inc.]
[051712_054721304][][EXCEPTION] [DEBUG] [java.vm.info]:[mixed mode]
[051712_054721305][][EXCEPTION] [DEBUG] [logfile]:[u02/erp/mfdevAPP/inst/apps/MFDEV_ffebapp04/logs/appl/conc/log/FNDOPP457384.txt]
[051712_054721305][][EXCEPTION] [DEBUG] [java.version]:[1.6.0_18]
[051712_054721305][][EXCEPTION] [DEBUG] [java.ext.dirs]:[u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/ext:/usr/java/packages/lib/ext]
[051712_054721305][][EXCEPTION] [DEBUG] [sun.boot.class.path]:[u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/resources.jar:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/rt.jar:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/sunrsasign.jar:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/jsse.jar:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/jce.jar:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/charsets.jar:/u02/erp/mfdevAPP/apps/tech_st/10.1.3/appsutil/jdk/jre/classes]
[051712_054721305][][EXCEPTION] [DEBUG] [java.vendor]:[Sun Microsystems Inc.]
[051712_054721305][][EXCEPTION] [DEBUG] [FND_JDBC_BUFFER_MAX]:[2]
[051712_054721305][][EXCEPTION] [DEBUG] [file.separator]:[]
[051712_054721305][][EXCEPTION] [DEBUG] [java.vendor.url.bug]:[http://java.sun.com/cgi-bin/bugreport.cgi]
[051712_054721305][][EXCEPTION] [DEBUG] [sun.io.unicode.encoding]:[UnicodeLittle]
[051712_054721305][][EXCEPTION] [DEBUG] [sun.cpu.endian]:[little]
[051712_054721305][][EXCEPTION] [DEBUG] [APPLOUT]:[out]
[051712_054721305][][EXCEPTION] [DEBUG] [sun.cpu.isalist]:[]
[5/17/12 5:47:23 PM] [UNEXPECTED] [457384:RT33169846] java.lang.reflect.InvocationTargetException
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:597)
at oracle.apps.xdo.common.xml.XSLT10gR1.invokeNewXSLStylesheet(XSLT10gR1.java:558)
at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:228)
at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:177)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1044)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:997)
at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:212)
at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1665)
at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:975)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5936)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3459)
at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3548)
at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:285)
at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:173)
Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'ref' used but not declared.
at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:806)
at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:571)
... 17 more
[5/17/12 5:47:23 PM] [457384:RT33169846] Completed post-processing actions for request 33169846.
[GC 21325K->4165K(63360K), 0.0107770 secs] -
ANN: XML Parser for Java v2.0.2.5
The v2.0.2.5 of the XML Parser for Java is now available for
download. The following features and bug fixes are included:
Conformance to the XSLT/XPATH October PR.
Support for internationalized error messages has been added. The
locale can be set using setLocale(java.util.Locale) function in
XSLProcessor, SAXParser, and DOMParser.
New APIs in XMLNode class:
value-of(String pattern)
selectNodes(String pattern)
selectSingleNode(String pattern)
selectSingleNode(String pattern, NSResolver ns)
New API in XSLStylesheet class
setParam(String param, String value)
Bug fixes:
Bug #957465: Missing a way to set stylesheet-level param-
variables
Bug #962290: selectNodes() improvements
Bug #1033472: Html output prints empty elements for non-empty
elements
Bug #1040717: Character entity for greater that in html output
style
Bug #1046003: Bug is parsing text nodes larger than 16K
Bug #1051671: 'xsl:namespace-alias' not supported
Bug #1052387: Disable-output-escaping doesn't flush while
printing
Bug #1053273: 'xsl:message' terminate attribute not supported
Bug #1058004: No access to media-type and encoding on xsl:output
Bug #1058008: xsl:version attribute not copied to result
Bug #1061159: Exclude-result-prefixes not supported
Bug #1067965: Bug in Non-validating parser while reading QNames
in DTD
This is the fifth 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 -
Installing XML Parser for Java v2
I downloaded Oracle XML Parser for Java v2 and looked in the doc directory of the unzipped files but couldn't find any doc about installation. Can anyone point me in the right the direction or tell me how to install and use it to convert XML files stored in the files system to HTML output using XSL stylesheet. Thanks
There is no installation involved beyond including the xmlparserv2.jar in your CLASSPATH. Take a look in the sample directory where we have included sample code and instructions on their use.
Addiaitonal HTML conversion samples are included with the XSQL Servlet download.
Oracle XML Team
null -
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
Maybe you are looking for
-
How to set text resources avoiding automatic page update with c:set tag
Hello everyone, I'm developing my web application with JDeveloper 11.1.2.3.0 in order to support two language locales (en and de). Following this guide I've performed the following steps: Creation of two property files (Resources.properties and Resou
-
In Dreamweaver CS5 - Spry elements visable in LiveView Only
Web page: www.muohio.edu/youth In Dreamweaver the Spry Tabbed Panels and Collapsible panels work fine as published, and in LiveView. However in Design View the tabbed panels only show the top content, the styling is not applied. The collapsible pane
-
I would like for the users middle initial or middle name to show in outlook 2010. I can set it in the header meaning I see the middle initial when the email comes in but its not in the signature. I read a post about the middle name attribute has to b
-
Strange route in Maps 2.0
If the map itself is wrong Navteq is the one to blame. What if the route that Maps 2.0 creates is totaly bizzare? Whos fault is that? Nokia? Message Edited by smoketoomuch on 07-Nov-2008 02:14 PM Solved! Go to Solution.
-
anyone with help would be great i have no clue what files i need or had....they alljust dissapeared one day and the webcams never worked again....like it dosent have one intergrated.