Can I route non-XML files with NW PI 7.0?
Hello,
I have NW 7.0 PI installed. I need to implement very simple scenario:
1. There are two folders Source and Target
2. Any file (non-XML, binary for example) comes to the Source folder
3. File needs to be picked up and routed without any modifications to the Target folder
Questions:
1. Can I implement that with NW? I guess I can
2. How do I do that? Is there any example or some description of implementing such a simple scenario (I have a few samples on how to implement complex scenarios that work with XML files, but I don't need that complexity)
Thanks in advance.
Hi,
Check out the Sravya's blogs for starters, It has lot of links which will help you to learn various pieces of XI.
Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part I
Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part II
Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part III
Thanks,
Pooja
Similar Messages
-
How can I save a XML file with JAXP1.1?
Dear All.
I write a program to create XML file with DOM model, but I can't know how to save it? My environment is JAXP1.1 and JDK1.3.1,I has been required not use other XML parser toolkits,only JAXP1.1.
How can I do? thank you.
Many person give me a idea the com.sun.xml.tree.XmlDocument, but I can't find the class in API document or JAXP1.1's packages. why?
what is it? How can i use it?
thank you very much.The way to save an XML Document is using a Transformer.
To have access to a transformer use the packages :
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
Then for saving your Document Object (named dXml) get a Transformer Object with the TransformerFactory Object :
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer();
Now you have got your Transformer Object, to save your Document Object use the method :
Document dXml = getMyDocument(); // this is your Document Object.
OutputStream osSave = getMySaveStream(); // this the OutputStream you need to save your Document.
try
t.transform(new DomSource(dXml), new StreamResult(new OutputStreamWriter(osSave)));
finally
osSave.close();
And your Document was now saved. -
How can (parse) i use XML file with missing EndTag
hi,
i have an application which writes an "XML file".
another application should read that XML file, build an DOM and
access the nodes with xpath.
my problem. if the first application is not finished there are tags
missing. e.g. </xml>. but the seconds application cannot wait until the first application finishes it task.
if i now read the XML file the parser cannot load it because the end tags are missing.
my question:
how can i deactivate the check or how can i read the XML file and access it via XPath (my application is using at the moment XPath to access the nodes and i dont want to change that)
as parser i am using XERCES
alexAs far as I know, you can't do this - xml must be well formed (this is sort of a bedrock of xml). There may be some work around's, but I'm not aware of any - and they would most likely be hacks.
-
How can i write a XML file with oracle data ?
How can i write a XML file using PL/SQL.
Can i do as follows.
1.Open a file using UTL_FILE.FOPEN(LC_DIR_LOC,'abc.xml','W') ;
2.write all the required tag and value using UTL.put_line
that is enough. Is not, please guide me to write.
gkHaving Oracle 9i.
One more doubt. In the speck, some constand values are there, When i write the same into file, How can i write ?.
1. l_str := ' "E27" '
or
2. l_str := ' E27 '
UTL_FILE.PUT_LINE(L_FILE_POI,l_str,TRUE);
1 case : in XML file : "E27"
In 2 case : E27
When we write a XML file through editors , we have to define the constant within quote . is it?
Which one can i use ? Or any other way is there ..
Thanks and Regards
gopi -
Reading xml file with sax parser: unknown protocol: c
Hi,
I've been googling around, and the best I can find is that the file name:
File test = new File("lib/test/parseTest/validate-test.xml");should be a url:
File test = new File("File://lib/test/parseTest/validate-test.xml");but I'm working on a linux machine and can't put "File://c:/pathToFile/file.xml"
Also, I did some testing and I can read a small xml file with just a few elements, but on large complex files, I get that error.
anyone ever run into this before?
bp
Edited by: badperson on Nov 1, 2008 2:19 PMbadperson wrote:
I've been googling around, and the best I can find is that the file name:
File test = new File("lib/test/parseTest/validate-test.xml");should be a url:
File test = new File("File://lib/test/parseTest/validate-test.xml");
No, that's wrong. The parameter for that constructor is a file path (relative or absolute). Not a URL. You must have misunderstood whatever you read.
but I'm working on a linux machine and can't put "File://c:/pathToFile/file.xml"What kind of a Linux machine is this which has a C drive? You must have misunderstood whoever told you to do that. -
How can i send xml file with a http servlet request
Hi
Please tell me how can I send a xml file into http servlet request.
I have a servlet(action) java file.From this servlet I have generate a xml file. Now I need to send that xml file to another servlet with http servlet request object.
Dave.When you say you have generated an XML file what do you mean?
Is it a file stored on disk? Then pass the file path as a string to the servlet.
Is it stored in memory as an object? The pass a reference to the object to the servlet.
Or are you asking how to communicate between servlets?
Look in the JavaDocs for the RequestDispatcher class. You can use this class to forward the request to another servlet. Data can be passes using the RequestDispatcher by storing it as attributes using the request getAttribute and setAttribute methods. Also described in the JavaDOcs.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/RequestDispatcher.html -
How Can I dispaly XML file with CSS?
hi,all
There is maybe a simple way to dispaly a XML file with a CSS file in program.But I don't know.Who can tell me?
Thank you very much!Hi,
XML documents don't have the link or style elements that are used in HTML to connect style information to particular documents. Instead, the W3C has defined a processing instruction that provides that information, based on the model of the HTML link element. To connect a CSS style sheet to your XML document so that the browser can find it, use a processing instruction like
<?xml-stylesheet type="text/css" href="URI"?>
where URI is the address of the style sheet. We'll use a style sheet called display1.css for our first test document. The processing instruction can go right after the XML declaration.
<?xml version="1.0" ?>
<?xml-stylesheet type="text/css" href="display1.css"?>
<test>
Hope this may help you.
Regards,
Anil.
Technical Support Engineer. -
Create xml file with values from context
Hi experts!
I am trying to implement a WD application that will have some input fields, the value of those input fields will be used to create an xml file with a certain format and then sent to a certain application.
Apart from this i want to read an xml file back from the application and then fill some other context nodes with values from the xml file.
Is there any standard used code to do this??
If not how can i do this???
Thanx in advance!!!
P.S. Points will be rewarded to all usefull answers.
Edited by: Armin Reichert on Jun 30, 2008 6:12 PM
Please stop this P.S. nonsense!Hi,
you need to create three util class for that:-
XMLHandler
XMLParser
XMLBuilder
for example in my XML two tag item will be there e.g. Title and Organizer,and from ur WebDynpro view you need to pass value for the XML tag.
And u need to call buildXML()function of builder class to generate XML, in that i have passed bean object to get the values of tags. you need to set the value in bean from the view ui context.
Code for XMLBuilder:-
Created on Apr 4, 2006
Author-Anish
This class is to created for having function for to build XML
and to get EncodedXML
and to get formated date
package com.idb.events.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.idb.events.Event;
public class XMLBuilder {
This attribute represents the XML version
private static final double VERSION_NUMBER = 1.0;
This attribute represents the encoding
private static final String ENCODING_TYPE = "UTF-16";
/*Begin of Function to buildXML
return: String
input: Event
public String buildXML(Event event) {
StringBuffer xmlBuilder = new StringBuffer("<?xml version=\"");
xmlBuilder.append(VERSION_NUMBER);
xmlBuilder.append("\" encoding=\"");
xmlBuilder.append(ENCODING_TYPE);
xmlBuilder.append("\" ?>");
xmlBuilder.append("<event>");
xmlBuilder.append(getEncodedXML(event.getTitle(), "title"));
xmlBuilder.append(getEncodedXML(event.getOrganizer(), "organizer"));
xmlBuilder.append("</event>");
return xmlBuilder.toString();
/End of Function to buildXML/
/*Begin of Function to get EncodedXML
return: String
input: String,String
public String getEncodedXML(String xmlString, String tag) {
StringBuffer begin = new StringBuffer("");
if ((tag != null) || (!tag.equalsIgnoreCase("null"))) {
begin.append("<").append(tag).append(">");
begin.append("<![CDATA[");
begin.append(xmlString).append("]]>").append("</").append(
tag).append(
">");
return begin.toString();
/End of Function to get EncodedXML/
/*Begin of Function to get formated date
return: String
input: Date
private final String formatDate(Date inputDateStr) {
String date;
try {
SimpleDateFormat simpleDateFormat =
new SimpleDateFormat("yyyy-MM-dd");
date = simpleDateFormat.format(inputDateStr);
} catch (Exception e) {
return "";
return date;
/End of Function to get formated date/
Code for XMLParser:-
Created on Apr 12, 2006
Author-Anish
This is a parser class
package com.idb.events.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import com.idb.events.Event;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
public class XMLParser {
Enables namespace functionality in parser
private final boolean isNameSpaceAware = true;
Enables validation in parser
private final boolean isValidating = true;
The SAX parser used to parse the xml
private SAXParser parser;
The XML reader used by the SAX parser
private XMLReader reader;
This method creates the parser to parse the user details xml.
private void createParser()
throws SAXException, ParserConfigurationException {
// Create a JAXP SAXParserFactory and configure it
SAXParserFactory saxFactory = SAXParserFactory.newInstance();
saxFactory.setNamespaceAware(isNameSpaceAware);
saxFactory.setValidating(isValidating);
// Create a JAXP SAXParser
parser = saxFactory.newSAXParser();
// Get the encapsulated SAX XMLReader
reader = parser.getXMLReader();
// Set the ErrorHandler
This method is used to collect the user details.
public Event getEvent(
String newsXML,
XMLHandler xmlHandler,
IWDMessageManager mgr)
throws SAXException, ParserConfigurationException, IOException {
//create the parser, if not already done
if (parser == null) {
this.createParser();
//set the parser handler to extract the
reader.setErrorHandler(xmlHandler);
reader.setContentHandler(xmlHandler);
InputSource source =
new InputSource(new ByteArrayInputStream(newsXML.getBytes()));
reader.parse(source);
//return the results of the parse
return xmlHandler.getEvent(mgr);
Code for XMLHandler:-
Created on Apr 12, 2006
Author-Anish
This is a parser class
package com.idb.events.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import com.idb.events.Event;
Created on Apr 12, 2006
Author-Anish
*This handler class is created to have constant value for variables and function for get events,
character values for bean variable,
parsing thr date ......etc
package com.idb.events.util;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
import java.util.*;
import com.idb.events.Event;
import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
public class XMLHandler extends DefaultHandler {
private static final String TITLE = "title";
private static final String ORGANIZER = "organizer";
IWDMessageManager manager;
private Event events;
private String tagName;
public void setManager(IWDMessageManager mgr) {
manager = mgr;
This function is created to get events
public Event getEvent(IWDMessageManager mgr) {
manager = mgr;
return this.events;
This function is created to get character for setting values through event's bean setter method
public void characters(char[] charArray, int startVal, int length)
throws SAXException {
String tagValue = new String(charArray, startVal, length);
if (TITLE.equals(this.tagName)) {
this.events.setTitle(tagValue);
if (ORGANIZER.equals(this.tagName)) {
String orgName = tagValue;
try {
orgName = getOrgName(orgName);
} catch (Exception ex) {
this.events.setOrganizer(orgName);
This function is created to parse boolean.
private final boolean parseBoolean(String inputBooleanStr) {
boolean b;
if (inputBooleanStr.equals("true")) {
b = true;
} else {
b = false;
return b;
This function is used to call the super constructor.
public void endElement(String uri, String localName, String qName)
throws SAXException {
super.endElement(uri, localName, qName);
/* (non-Javadoc)
@see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
This function is used to call the super constructor.
public void fatalError(SAXParseException e) throws SAXException {
super.fatalError(e);
This function is created to set the elements base on the tag name.
public void startElement(
String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException {
this.tagName = localName;
if (ROOT.equals(tagName)) {
this.events = new Event();
public static void main(String a[]) {
String cntry = "Nigeria";
XMLHandler xml = new XMLHandler();
ArrayList engList = new ArrayList();
engList = xml.getCountries();
ArrayList arList = xml.getArabicCountries();
int engIndex = engList.indexOf(cntry);
System.out.println("engIndex :: " + engIndex);
String arCntryName = (String) arList.get(engIndex);
System.out.println(
">>>>>>>>>>>>>>>>>>>>" + xml.getArabicCountryName(cntry));
Hope that may help you.
If need any help , you are most welcome.
Regards,
Deepak -
Sending XML Files with Certificate
Hello everybody.
I need develop an abap program for sending XML files with a certificate.
How I can create this certificate?
Somebody have an idea?
Thank you everybody.
NelsonMikael,
This sounds like one of the many quirks (perhaps bugs) related to how FrameMaker handles non-FM files in books. The current book model doesn't play well with XML files as chapters and this seems like yet another problem. Apparently, if an xref does not target another .fm file in the book, Frame assumes that the target file is not in the book and therefore will not be in the book PDF.
There have been discussions here about this in the past. The solution that I use is to run an API client before publishing that converts all XML files to .fm files, and redirect all xrefs appropriately. Then, book features work as expected and PDFs come out as normal. This is not feasible, however, without the automation from the API client.
There may be some who would say that the best approach is to use XML and books the way that the designers did account for... that is, the whole book becomes an XML document with entity references to the separate chapters. In my work, though, this model was not appropriate... rather, I needed a binary FM book to act like a book, except with XML files as chapters. So, I think I understand your situation.
Is API programming or FrameScript an option for you? I think it may be the only way to get what you are looking for.
Russ -
Generation of Xml file with java output
Hi i m new to xml and java combination. I have a name value pair kind of output returning from java program. I want to generate the new xml file with the data. Could some one help me out in generating xml file with the data. Could anyone send me the java code that does this task.
Let me know which parser are you using currently for reading xml files so that i assist you. For now, you can refer to STAX Parser API under this link
http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP3.html -
Creating an XML file with CFFILE on UNIX server
I've run into a problem with creating an XML file on a UNIX
server. I don't have access to the server and I'm trying to create
an XML file so an outside agency can read it through the site URL.
On a Windows machine I use GetDirectoryFromPath and
ExpandPath to return the drive/path info, then I create the file
with this and the query result. On the Unix web server I am only
being returned a relative path, because of this I can't write the
XML file to the web server. Any idea how to get around this?Knowing as little as I do about Unix I thought you still needed
a drive "letter" to write the XML file to. I've been told I can get
to the root but that it's root is "/bottomFolderName" (I was
expecting R:\webRootPath\yourFolder\etc\XMLFileWrittenHere).
No, that is Windows thinking. You were told right. In Linux,
a path usually begins with the forward slash /.
I had doubts about your code itself. Did you run your version
of my example on Windows? If it works, then you will only have to
replace the Windows path with something like the following. The
rest of the code remains the same. -
Creating XML files with the DME
Hi All,
I'm working on an integration project between my company and HSBC, they are requesting that we supply our AP payment files for foreign currency in XML format.
I have some limited experience with the DME and know it can create XML files, however, the elements available for XML files are different to standard flat files. Also it doesnt seem like I can create files with multiple levels? e.g.
<InitgPty>
......... <Id>
............... <OrgId>
...................... <BkPtyId>ABC00103003</BkPtyId>
.............. </OrgId>
........ </Id>
</InitgPty>
Does anyone have any documentation or experience with creating XML files with DME?
thanks
Phil.Hi,
Please ask any Implementation team in ABAB or Report painter team with your friends,
Thanks and REgards
N.Soma Sundaram -
My report contains a BLOB (image), why it can't generate an XML file?
Hi guys,
I created a report (Purchase Order) and it has a Signature field.
which is a BLOB column of an image (.JPEG) of the signature of the Purchase Order Approver.
When i run the report in the report builder its working and it shows the image of the signature.
BUT when i try to generate xml file to use it for the XML Publisher, it generates an xml file with error. which can't be loaded into the .rtf file.
i Googled around and it seems that there are limitations in XML Publisher that can not load a BLOB or LONG RAW fields.
So Please guys i need your help! what can i do now ?
They need the Purchase Order in a custom PDF format, which i can only make it with XML Publisher.
Best Regards,Hello,
For questions about BI Publisher (Formelly XML Publisher) :
BI Publisher
Regards -
Combine several XML files with same structure
Hello,
I have several XML files with the same structure and I want to combine them and create a new XML file to be bale to compare that information easily. It does not look very difficult but as I am very new in this I am not bale to get it
The structure of my actual files would be something simlar to:
Root->...-> Name->Address, Telephone
And what I would like to have si something like
Root->.... ->Address-> Name 1,Name 2....
Root -> ...->Telephone-> Name 1, Name 2....
Does anyone know how to do this.
ThanksYou could write a XSL transformation file that does this and transform your input file via
* Transform XML file with a style sheet.
* <p><b>Example:</b><p>
<table align="center" bgcolor="#E0E0E0" border=1 cellpadding="10" cellspacing="0"><tr><td><pre style="margin-top:0; margin-bottom:0">
XMLTransformer t = new XMLTransformer();
FileOutputStream fos = new FileOutputStream("C:/Project/result.html");
String xmlFile = "C:/Project/source.xml";
String styleSheet = "C:/Project/stylesheet.xsl";
t.transform(xmlFile, styleSheet, fos);
</pre></td></tr></table>
* @param xmlfile The XML file to transform.
* @param style Stylesheet to use for transformation.
* @param outputStream OutputStream to write the transformed result to.
public void transform(String xmlfile, String style, OutputStream outputStream) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
//factory.setNamespaceAware(true);
//factory.setValidating(true);
//todo: use inputstreams instead of file names
try {
File stylesheet = new File(style);
File datafile = new File(xmlfile);
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(datafile);
// Use a Transformer for output
TransformerFactory tFactory = TransformerFactory.newInstance();
StreamSource stylesource = new StreamSource(stylesheet);
Transformer transformer = tFactory.newTransformer(stylesource);
DOMSource source = new DOMSource(document);
StreamResult sr = new StreamResult(outputStream);
transformer.transform(source, sr);
} catch (TransformerConfigurationException tce) {
// Error generated by the parser
System.out.println ("\n**XMLTransformerr Factory error");
System.out.println(" " + tce.getMessage() );
// Use the contained exception, if any
Throwable x = tce;
if (tce.getException() != null) {
x = tce.getException();
x.printStackTrace();
} catch (TransformerException te) {
// Error generated by the parser
System.out.println ("\n** Transformation error");
System.out.println(" " + te.getMessage() );
// Use the contained exception, if any
Throwable x = te;
if (te.getException() != null) {
x = te.getException();
x.printStackTrace();
} catch (SAXException sxe) {
// Error generated by this application
// (or a parser-initialization error)
Exception x = sxe;
if (sxe.getException() != null) {
x = sxe.getException();
x.printStackTrace();
} catch (ParserConfigurationException pce) {
// Parser with specified options can't be built
pce.printStackTrace();
} catch (IOException ioe) {
// I/O error
ioe.printStackTrace();
}//transform() -
How to parse XML file with namesapce?
Hi,
I am trying to parse an xml file having namespace. But no data is returned.
Sample Code:
public class XMLFileLoader
var xml:XML = new XML();
var myXML:XML = new XML();
var XML_URL:String = "file:///C:/Documents and Settings/Administrator/Desktop/MyData.xml";
var myLoader:URLLoader = null;
public function XMLFileLoader()
var myXMLURL:URLRequest = new URLRequest(XML_URL);
myLoader= new URLLoader(myXMLURL);
myLoader.addEventListener(Event.COMPLETE,download);
public function download(event:Event):void
myXML = XML(myLoader.data);
var ns:Namespace=myXML.namespace("xsi");
for(var prop:String in myXML)
trace(prop);
//Alert.show(myXML..Parameters);
//trace("Data loadedww."+myXML.toString());
//Alert.show(myXML.DocumentInfo.attributes()+"test","Message");
The XML Contains the following format.
<Network xmlns="http://www.test.com/2005/test/omc/conf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.test.com/2005/test/omc/conf/TestConfigurationEdition3proposal4.xsd">
<TestDomain>
<WAC>
<!--Release Parameter -->
<Parameters ParameterName="ne_release" OutageType="None"
accessRight="CreateOnly" isMandatory="true"
Planned="false"
Reference="true" Working="true">
<DataType>
<StringType/>
</DataType>
<GUIInfo graphicalName="Release"
tabName="All"
description="Describes the release version of the managed object"/>
</Parameters>
</TestDomain>
</Network>
Any sample code how to parse this kind of xml file with namespaces...
Regards,
Purushothami have exactly the same problem with KXml2, but using a j2me-polish netbeans project.
i've tried to work around with similar ways like you, but none of them worked. now i've spent 3 days for solving this problem, i'm a bit disappointed :( what is wrong with setting the downloaded kxml2 jar path in libraries&resources?
screenshot
Maybe you are looking for
-
My friend cannot view my XML pages correctly, is there a setting he is missing?
A friend of mine wanted an easy way to create a help page for his program written in Java. He did not want to get into HTML. I wrote an XSl module and an XML where he could add chapters & text. It works fine on my system using FF or even IE. I am on
-
despite best efforts, our mac (less than 4 years old) is SLOW. No viruses, plenty of avaliable space, clean desktop, no startup programs etc. Suggestions?!
-
Error when running deployed application on AS
When deploying an application to Oracle AS 10.1.3, I experience no problems. When running the application, I receive an error: Error getting property 'currentModule' from bean of type oracle.jheadstart.controller.jsf.bean.DynamicMenuBean: javax.faces
-
Hello All, I installed the Test Portal server in my local machine. But once i stop my server and again i am starting server then i am getting jcontrol.exe is stopped. for that what i need to do ? is any configuration is required ? can you please help
-
Hi...Just got a Ipod and in our house we have 3 ipod touch total. Can we put 3 ipods in itune?