Produce XML file with a given DTD
I have only installed XSU, and I was hopping to use pl/sql package XMLGEN to generate XML with a given DTD and a sql query.
I can't find input parameter for DTD. Well it seems logical as both DTD and SQL are for defining the XML output file.
How can this be done ?
Thanks.
/Kwan
Sure. You could write an EntityResolver to do that. Attach it to your DocumentBuilder or XMLReader, depending on which you are using.
Similar Messages
-
Pls help - produce xml file with an agreed-upon DTD
I posted this a few weeks ago:
I have only installed XSU, and I was hopping to use pl/sql package XMLGEN to generate XML with a given DTD and a sql query.
I can't find input parameter for DTD. Well it seems logical as both DTD and SQL are for defining the XML output file.
How can this be done ?
Thanks.
/Kwan
Do I need to process the DTD to generate Java classes ? and then create XML document by a java application ?
I am in a pl/sql shop and I am not eager to go java because I need to use a DTD.
comments / help ?
thanks.
/Kwan
I am in a pl/sql shopCross-post: http://forum.java.sun.com/thread.jspa?threadID=784467&messageID=4459240#4459240
-
Parse xml file with validating againat dtd
i have a xlm file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map SYSTEM "map.dtd">
<map width="20" height="15" goal="25" name="eXtreme Labyrinth of Dooom">
<random-item type='lantern' amount='5' />
<random-item type='health' amount='10' />
<tile x="14" y="0" type="wall">
<renderhint>wall:rock,cracked</renderhint>
</tile>
<tile x="15" y="0" type="wall" />
<tile x="16" y="0" type="floor">
<renderhint>floor:marble,cracked</renderhint>
</tile>
<tile x="17" y="0" type="floor">
<renderhint>floor:stone,rubble</renderhint>
</tile>
<tile x="18" y="0" type="floor" />
<tile x="0" y="1" type="floor" />
<tile x="1" y="1" type="floor" startlocation="1" />
<tile x="2" y="1" type="floor" />
<tile x="3" y="1" type="floor">
<item type="treasure">Bar of Silver</item>
<renderhint>floor:stone,blood</renderhint>
</tile>
<tile x="4" y="1" type="wall" />
<tile x="5" y="1" type="wall" />
<tile x="6" y="1" type="wall">
<renderhint>wall:bricks,cracked</renderhint>
</tile>
</map>and a dtd document like:
<!ELEMENT map (random-item+, tile+)>
<!ATTLIST map
width CDATA #REQUIRED
height CDATA #REQUIRED
goal CDATA #REQUIRED
name CDATA #REQUIRED
<!ELEMENT random-item EMPTY>
<!ATTLIST random-item
type (armour|health|sword|treasure|lantern) #REQUIRED
amount CDATA #REQUIRED
<!ELEMENT tile (item|renderhint)*>
<!ATTLIST tile
x CDATA #REQUIRED
y CDATA #REQUIRED
type (exit|floor|wall) #REQUIRED
startlocation CDATA #IMPLIED
<!ELEMENT item (#PCDATA)>
<!ATTLIST item
type (armour|health|sword|treasure|lantern) #REQUIRED
<!ELEMENT renderhint (#PCDATA)>i need to validate the xml file against the dtd document and parse it to java using DOM.
Can anyone give ma any suggestions on how to do it?
thank youi have started my coding like:
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
import java.io.*;
class loadxml
public static void main(String[] args)
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(true);
factory.setIgnoringElementContentWhitespace(true);
DocumentBuilder parser = factory.newDocumentBuilder();
Document doc = parser.parse(new File("hallways.xml"));
loadxml load = new loadxml();
load.parseNode(doc);
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
public void parseNode (Node node) throws IOException
// here is where i have problem with
}since in my xml file, i have got ATTLIST, this ready confuses me when i try to coding it.
Can anyone help me, please.
Thank you.
Edited by: mujingyue on Mar 12, 2008 3:10 PM -
To read XML file with DTD in SSIS
Hi,
My SISS package needs to read .mak file and store it in a sql tables.
I am receiving xml file content in mak file extension with DTD. So I couldn't read through XML source shows error DTD is prohibited in this document. After removing DTD by manually, the xml file has multiple outputs.
Please guide me how to remove DTD by coding and also I don't have xsd and xsl file for this only mak file.
Thanks.Thanks Visakh for your answer.
I have tried in XML task which described in the thread. But I couldn't remove DTD file, I am getting following error,
[XML Task] Error: An error occurred with the following error message: "Could not find a part of the path 'C:\Program Files (x86)\FAST\Builder\bin\makefile.dtd'.".
As I said before I am receiving in .mak file extension. The beginning of file content is like below,
<?xml version='1.0'?>
<!DOCTYPE makefile SYSTEM "file:///C:/ProgramFiles
(x86)/FAST/Builder/bin/makefile.dtd"[
<!ENTITY % default-content-type "'text/html'">
<!ENTITY prjdir "G:\cdrom\Employees_2014_02">
<!ENTITY imgdir "G:\images\forms\gifs">
<!ENTITY foddir "G:\SOFT\FORMS CD\Feb14">
<!ENTITY ccdir "Y:\Content">
]>
<makefile>
&fsysdse;
<content-collection id="b1" title="Employers and Employees" filename="&ccdir;\Employees_2014_02.nfo" password=""> ....
After replace all variable (prjdir,imgdir,fodder,ccdir) into values specified in the entity tag, I removed above underlined part - so the xml file is ready without DTD part and able to use in
XML source. I have received 6 outputs from XML source.
My question is how to do this manual work in SSIS? It’s not only one file, so many files needs to updated SQL tables automatically so everything should be done by coding.
Please guide me in which way I can achieve this?
If you want to do this in SSIS
one way is to use Script Task to parse the file and remove the DTD part.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Validating generated XML file with DTD
Hello all,
my requirement is to test the XML file with its DTD.
we are creating an XML file, before writing it on the application server , we need to test it with its DTD.
i found one method set_validating in the interface if_ixml_parser , for validating XML file, but not getting an idea how to use it, like how to link the DTD to XML etc.
if i try to use the above method am getting the following error:
Unable to retrieve the external entity 'd:\dtdfile.dtd'.
where 'd:\dtdfile.dtd' is the path of the DTD file included in the Doctype of the XML file.
Please help me to solve this.
Thx in advance.Hello,
Did you find your answer ?
I know how to validate an XML file an internal DTD, but not an external one... If you know, can you pelase advice ?
If you didn't found yet, you need to use method get_reason() to get the description of the error.
best regards,
Gilles. -
Can I validate an XML file using an external DTD
Hi,
I'm trying to use an external DTD to validate an XML
file (which does not refer to this DTD). The java docs that ship
with the XML parser aren't clear on how exactly to do this (or
whether it can be done). I'd appreciate any advice on how I
should perform this operation.
Here's what I'm doing right now.
1) The Java file
import oracle.xml.parser.v2.*;
public class ParseWithExternalDTD
public static void main(String args[]) throws Exception
DOMParser dp=new DOMParser();
dp.parseDTD
("file:d:/jdk1.2/sample/test/family.DTD","family");
DTD dtd=dp.getDoctype();
dp.setDoctype(dtd);
dp.parse("file:d:/jdk1.2/sample/test/family.xml");
System.out.println("Finished with no errors!");
2) The family.DTD file
<!ELEMENT family (member*)>
<!ATTLIST family lastname CDATA #REQUIRED>
<!ELEMENT member (#PCDATA)>
<!ATTLIST member memberid ID #REQUIRED>
<!ATTLIST member dad IDREF #IMPLIED>
<!ATTLIST member mom IDREF #IMPLIED>
3) The family.xml file
<?xml version="1.0" standalone="no"?>
<family lastname="Smith">
<TagToFoilParserValidation>
</TagToFoilParserValidation>
<member memberid="m1">Sarah</member>
<member memberid="m2">Bob</member>
<member memberid="m3" mom="m1" dad="m2">Joanne</member>
<member memberid="m4" mom="m1" dad="m2">Jim</member>
</family>
4) The output
Finished with no errors!
As you can see, the DOMParser failed to validate the family.xml
file against the family dtd otherwise, it would have reported a
validation error when it came across the
TagToFoilParserValidation.
Any insight as to what I'm doing wrong would be much appreciated.
Sincerely,
Keki
Project Iona
Manufacturing Applications
Oracle Corporation
The views and opinions expressed here are
my own and do not reflect the views and
opinions of Oracle Corporation
nullKeki Burjorjee (Oracle) (guest) wrote:
: 2 further questions related to this issue.
: 1) Say I am using XSLT to transform A.xml into B.xml, and I
: want to embed a reference to B.dtd within the B.xml file. Is
: there an XSLT command which will allow me to do this?
: 2) Is it possible for your team to give me a mechanism whereby
I
: can preset the xml parser to validate the next xml file (or
: inputstream) it receives against a particular DTD? This scheme
: does not require the dtd to be present within the XML file
: Thanks,
: - Keki
: Oracle XML Team wrote:
: : What you are doing wrong is not including a reference to the
: : applicable DTD in your XML document. Without it there is no
: way
: : that the parser knows what to validate against. Including
the
: : reference is the XML standard way of specifying an external
: : DTD. Otherwise you need to embed the DTD in your XML
Document.
: : Oracle XML Team
: : http://technet.oracle.com
: : Oracle Technology Network
: : Keki Burjorjee (guest) wrote:
: : : Hi,
: : : I'm trying to use an external DTD to validate an XML
: : : file (which does not refer to this DTD). The java docs that
: : ship
: : : with the XML parser aren't clear on how exactly to do this
: (or
: : : whether it can be done). I'd appreciate any advice on how I
: : : should perform this operation.
: : : Here's what I'm doing right now.
: : : 1) The Java file
: : : import oracle.xml.parser.v2.*;
: : : public class ParseWithExternalDTD
: : : public static void main(String args[]) throws Exception
: : : DOMParser dp=new DOMParser();
: : : dp.parseDTD
: : : ("file:d:/jdk1.2/sample/test/family.DTD","family");
: : : DTD dtd=dp.getDoctype();
: : : dp.setDoctype(dtd);
: : : dp.parse("file:d:/jdk1.2/sample/test/family.xml");
: : : System.out.println("Finished with no errors!");
: : : 2) The family.DTD file
: : : <!ELEMENT family (member*)>
: : : <!ATTLIST family lastname CDATA #REQUIRED>
: : : <!ELEMENT member (#PCDATA)>
: : : <!ATTLIST member memberid ID #REQUIRED>
: : : <!ATTLIST member dad IDREF #IMPLIED>
: : : <!ATTLIST member mom IDREF #IMPLIED>
: : : 3) The family.xml file
: : : <?xml version="1.0" standalone="no"?>
: : : <family lastname="Smith">
: : : <TagToFoilParserValidation>
: : : </TagToFoilParserValidation>
: : : <member memberid="m1">Sarah</member>
: : : <member memberid="m2">Bob</member>
: : : <member memberid="m3" mom="m1" dad="m2">Joanne</member>
: : : <member memberid="m4" mom="m1" dad="m2">Jim</member>
: : : </family>
: : : 4) The output
: : : Finished with no errors!
: : : As you can see, the DOMParser failed to validate the
: : family.xml
: : : file against the family dtd otherwise, it would have
: reported
: : a
: : : validation error when it came across the
: : : TagToFoilParserValidation.
: : : Any insight as to what I'm doing wrong would be much
: : appreciated.
: : : Sincerely,
: : : Keki
: : : Project Iona
: : : Manufacturing Applications
: : : Oracle Corporation
: : : The views and opinions expressed here are
: : : my own and do not reflect the views and
: : : opinions of Oracle Corporation
1) No XSLT commands exist that allow you to embed a DTD while
doing the transformation.
2) You can use the setDocType() method in the parser, to set a
DTD based on which the XML document will be validated. The
parseDTD() method allows you to parse a DTD file separately and
get a DTD object. Here is a sample code :
DOMParser domparser = new DOMParser();
domparser.setValidationMode(true);
// parse the DTD file
domparser.parseDTD(new FileReader(dtdfile));
DTD dtd = domparser.getDocType();
// Parse XML file - XML file will be validated based on the DTD.
domparser.setDocType(dtd);
domparser.parse(new FileReader(xmlfile));
Document doc = domparser.getDocument();
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null -
Validate a XML file with a XSD File in ABAP
Hi everybody,
I am searching a way for validating a XML File with an external XSD File in ABAP. I know to validate with dtd is possible, but what about XSD?
Can you help me in my urgend problem ?
Greetings from Germany
ismail eranyone an idea for my issue ???
-
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. -
Steps in converting a xml file with an rtf template to a pdf
Hey all,
What are the steps in converting a xml file with an rtf template to a pdf using XML Publisher from command line.
Thanks
RaviI don't have any code to do exactly what you wish, but it shouldn't be too difficult and http://www.dadhi.com/2007/06/generate-and-store-pdf-file-in-same.html is a good starting point.
Paul -
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 -
Create XML file with worksheet's dynamically assigned through XSLT
Hi all
I have a requirement to create a xml file with worksheets dynamically created based on a field value in the internal table .
I have all my values in internal table, and am calling the transformation from bsp application.
Say the internal table has field dataxyz, for every change in value in this field dataxyz i need to create separate worksheet and populate that sheet with some corresponding values .
please guide me how to create worksheet dynamically.
thanks in advance.
Bharathy
Edited by: elam.bharathy on May 16, 2011 6:51 AMCan you use a schema when we compose XML doc from Database tables?
Actually, I'm using SQL Server (sorry, wrong forum). But, I thought a Java tool would have a solution for me. -
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 -
Transfer 100M XML file with XSL
Hi,
I am trying to transfer 100M XML file with XSL. Input.xml is the XML file, format.xsl is the XSL file. I type in the command line as:
java org.apache.xalan.xslt.Process -IN input.xml -XSL format.xsl -OUT output.xml
It got "out of memeory" error. My questions are:
1. Is it possible to transfer such large XML file with XSLT?
2. The XSL processor used SAX or DOM to parse XML file?
3. Any suggestions?
Thanks.
Jamesmaybe?
java -Xmx200m org.apache.xalan.xslt.Process -IN input.xml -XSL format.xsl -OUT output.xml
http://java.sun.com/j2se/1.3/docs/tooldocs/win32/java-classic.html -
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 -
XML file with an attached MIME encoded ZIP file
Hi all,
I'm new to SAP WAS and MIME encoding/decoding, and I'm trying to generate an XML file with an attachment which is also MIME encoded.
1) I have dummy files (1.jpg, 2.jpg) and I'm trying to zip these files into one zip file (files.zip).
2) I'm trying to MIME encode/decode this zip file.
3) I'm trying to attach this MIME encoded zip file to existing XML file.
Which FMs could I use to accomplish this? Your help is very appreciated.
Thank you.
below is a file example that I'm trying to generate.
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="--XXXXboundary text"
Content-Transfer-Encoding: 7bit
This is a multi-part message in MIME format.
--XXXXboundary text
Content-Type: text/xml;
charset="utf-8"
Content-Transfer-Encoding: 8bit
<?xml version="1.0" encoding="utf-8"?>
<abc/>
<def/>
--XXXXboundary text
Content-Type: application/octet-stream; name="files.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
UEsDBBQAAAAIAI9EejAs5k34H84DAAYgBAAMAAAAMDAyMjQ5MTEucGRmnLsJWBNJ2zb6jmJIIIFE
BAMIJGEVBSKGRRAhEGQNoGwKYoiAEnYRUFGIkBAQFzYXRNHAAEGQZRy2ATFDUAHfGScSIUwQMMrM
ECGADptA0n/jzLtc//dd51znVAKdru6uqn7q6fu5764qQzJust create an applet (extend JApplet)... add a JTextArea to it....fill the text area with the text from an XML doc.
To get the text of the XML doc just do something like..
File xmlFile = new File("<path to xml file>");
FileInputStream fis = new FileInputStream(xmlFile);
byte[] bytes = new byte[(int) xmlFile.length()];
fis.read(bytes);
fis.close();
String xmlText = new String(xmlBytes);
textArea.setText(xmlText);
...try something like that (assuming..i understand what it is u want)
Maybe you are looking for
-
i forgot the security questions on my old account so i had to make a new one and i put my $30 voucher on my old account
-
Asynchronous View creation in CE 7.2 SP 05
Hi Experts , Can you help me to create Asynchronous View in CE 7.2 SP05. any help will greatly appricated. Thanks AB
-
How to Change status text in ESS travel managemnet screen
Dear All, What is the procedure to change the status/processing status text change in travel management ESS screen. Regards, Palia
-
Problems with new installation of iAS on Windows
This is a new installation of iAS 10.1.2.0.2 on Windows. The application server doesn't come up properly after reboot. The log file D:\Oracle\ora101_infra\opmn\logs\OC4J~OC4J_SECURITY~default_island~1 contains an error stack that begins with: SSO: DB
-
Hi Folks, I'm having a difficult time getting the Live Data function to work. I'm working on Mac OSX 10.3.9, running DW8. I've got the Apache server running (built into OS) and I've got MySQL and PHP successfully installed. I was able to create a dat