Decrypt and unzip a File + read a XML file received into the ZIP

Hello,
I need your help to develop some a complex Biztalk application.
Here're my needs :
Our Busness partner send us a zip file cripted with a standard PGP(Pretty Goof Privacy).
The zip containts an XML file that i have to deal it, and some attachments file(PDF).
So i need to know what's the best approach for the developpement of my application.
I want to decrypt the ZIP and then Unzip the file and them read the XML file received in the zip.
Knowimg that we already have the pipeline compenent to dectypt the file with the strandar PGP and an other pipeline compenent to unzip the File.
Thank you

Hi ,
Try this code to unzip the file and send the xml message .If u face issue let me know
namespace BizTalk.Pipeline.Component.DisUnzip
using System;
using System.IO;
using System.Text;
using System.Drawing;
using System.Resources;
using System.Reflection;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using Microsoft.BizTalk.Message.Interop;
using Microsoft.BizTalk.Component.Interop;
using Microsoft.BizTalk.Component;
using Microsoft.BizTalk.Messaging;
using Ionic.Zip;
using System.IO.Compression;
[ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
[System.Runtime.InteropServices.Guid("8bef7aa9-5da5-4d62-ac5b-03af2fb9d280")]
[ComponentCategory(CategoryTypes.CATID_DisassemblingParser)]
public class DisUnzip : Microsoft.BizTalk.Component.Interop.IDisassemblerComponent, IBaseComponent, IPersistPropertyBag, IComponentUI
private System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager("BizTalk.Pipeline.Component.DisUnzip.DisUnzip", Assembly.GetExecutingAssembly());
#region IBaseComponent members
/// <summary>
/// Name of the component
/// </summary>
[Browsable(false)]
public string Name
get
return resourceManager.GetString("COMPONENTNAME", System.Globalization.CultureInfo.InvariantCulture);
/// <summary>
/// Version of the component
/// </summary>
[Browsable(false)]
public string Version
get
return resourceManager.GetString("COMPONENTVERSION", System.Globalization.CultureInfo.InvariantCulture);
/// <summary>
/// Description of the component
/// </summary>
[Browsable(false)]
public string Description
get
return resourceManager.GetString("COMPONENTDESCRIPTION", System.Globalization.CultureInfo.InvariantCulture);
#endregion
#region IPersistPropertyBag members
/// <summary>
/// Gets class ID of component for usage from unmanaged code.
/// </summary>
/// <param name="classid">
/// Class ID of the component
/// </param>
public void GetClassID(out System.Guid classid)
classid = new System.Guid("8bef7aa9-5da5-4d62-ac5b-03af2fb9d280");
/// <summary>
/// not implemented
/// </summary>
public void InitNew()
/// <summary>
/// Loads configuration properties for the component
/// </summary>
/// <param name="pb">Configuration property bag</param>
/// <param name="errlog">Error status</param>
public virtual void Load(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, int errlog)
/// <summary>
/// Saves the current component configuration into the property bag
/// </summary>
/// <param name="pb">Configuration property bag</param>
/// <param name="fClearDirty">not used</param>
/// <param name="fSaveAllProperties">not used</param>
public virtual void Save(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, bool fClearDirty, bool fSaveAllProperties)
#region utility functionality
/// <summary>
/// Reads property value from property bag
/// </summary>
/// <param name="pb">Property bag</param>
/// <param name="propName">Name of property</param>
/// <returns>Value of the property</returns>
private object ReadPropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName)
object val = null;
try
pb.Read(propName, out val, 0);
catch (System.ArgumentException )
return val;
catch (System.Exception e)
throw new System.ApplicationException(e.Message);
return val;
/// <summary>
/// Writes property values into a property bag.
/// </summary>
/// <param name="pb">Property bag.</param>
/// <param name="propName">Name of property.</param>
/// <param name="val">Value of property.</param>
private void WritePropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName, object val)
try
pb.Write(propName, ref val);
catch (System.Exception e)
throw new System.ApplicationException(e.Message);
#endregion
#endregion
#region IComponentUI members
/// <summary>
/// Component icon to use in BizTalk Editor
/// </summary>
[Browsable(false)]
public IntPtr Icon
get
return ((System.Drawing.Bitmap)(this.resourceManager.GetObject("COMPONENTICON", System.Globalization.CultureInfo.InvariantCulture))).GetHicon();
/// <summary>
/// The Validate method is called by the BizTalk Editor during the build
/// of a BizTalk project.
/// </summary>
/// <param name="obj">An Object containing the configuration properties.</param>
/// <returns>The IEnumerator enables the caller to enumerate through a collection of strings containing error messages. These error messages appear as compiler error messages. To report successful property validation, the method should return an empty enumerator.</returns>
public System.Collections.IEnumerator Validate(object obj)
// example implementation:
// ArrayList errorList = new ArrayList();
// errorList.Add("This is a compiler error");
// return errorList.GetEnumerator();
return null;
#endregion
/// <summary>
/// this variable will contain any message generated by the Disassemble method
/// </summary>
private System.Collections.Queue _msgs = new System.Collections.Queue();
#region IDisassemblerComponent members
/// <summary>
/// called by the messaging engine until returned null, after disassemble has been called
/// </summary>
/// <param name="pc">the pipeline context</param>
/// <returns>an IBaseMessage instance representing the message created</returns>
public Microsoft.BizTalk.Message.Interop.IBaseMessage
GetNext(Microsoft.BizTalk.Component.Interop.IPipelineContext pc)
// get the next message from the Queue and return it
Microsoft.BizTalk.Message.Interop.IBaseMessage msg = null;
if ((_msgs.Count > 0))
msg = ((Microsoft.BizTalk.Message.Interop.IBaseMessage)(_msgs.Dequeue()));
return msg;
/// <summary>
/// called by the messaging engine when a new message arrives
/// </summary>
/// <param name="pc">the pipeline context</param>
/// <param name="inmsg">the actual message</param>
public void Disassemble(Microsoft.BizTalk.Component.Interop.IPipelineContext pc, Microsoft.BizTalk.Message.Interop.IBaseMessage inmsg)
IBaseMessage Temp = inmsg;
using (ZipFile zip = ZipFile.Read(inmsg.BodyPart.GetOriginalDataStream()))
foreach (ZipEntry e in zip)
var ms = new MemoryStream();
IBaseMessage outMsg;
outMsg = pc.GetMessageFactory().CreateMessage();
outMsg.AddPart("Body", pc.GetMessageFactory().CreateMessagePart(), true);
outMsg.Context=inmsg.Context;
e.Extract(ms);
string XMLMessage = Encoding.UTF8.GetString(ms.ToArray());
MemoryStream mstemp = new System.IO.MemoryStream(
System.Text.Encoding.UTF8.GetBytes(XMLMessage));
outMsg.GetPart("Body").Data = mstemp;
_msgs.Enqueue(outMsg);
#endregion
Thanks
Abhishek

Similar Messages

  • Reading a XML file in a standalone java application

    Hi,
    What are my options if I have a standalone java application running outside any app. server and I need to read an XML file, probably read some of the attributes in the file...? Please explain clearly as I'm new to this. Appreciate your help.
    Thanks,
    Mahdad

    nope you don't need a DTD
    you have to write your Java code in a way that doesn't rely too much on the structure:
    - avoid getFirstChild().getFirstChild()... because you know that this element is first grandson of that element)
    - prefer using getElementByTagName() or some XPath() API
    but if the XML completely changes, well, yeah, you have to do some programmation: better think well your document structure in the beginning.

  • Reading A xml file and sending that XML Data as input  to a Service

    Hi All,
    I have a requirement to read(I am using File adapter to read) a xml file and map the data in that xml to a service(schema) input variable.
    Example of  xml file that I have to read and the content of that xml file like below:
      <StudentList>
        <student>
           <Name> ravi</Name>
           <branch>EEE</branch>
          <fathername> raghu</fathername>
        </student>
      <student>
           <Name> raju</Name>
           <branch>ECE</branch>
          <fathername> ravi</fathername>
        </student>
    <StudentList>
    I have to pass the data(ravi,EEE,raghu etc) to a service input varible. That invoked Service input variable(schema) contains the schema similar to above schema.
    My flow is like below:
      ReadFile file adapter -------------------> BPEL process -----> Target Service.I am using transform activity in BPEL process to map the data from xml file to Service.
    I am using above xml file as sample in Native Data format(to create XSD schema file).
    After I built the process,I checked file adapter polls the data and receive the file(I am getting View xml document in EM console flow).
    But transform activity does not have anything and it is not mapping the data.I am getting blank data in the transform activity with only element names like below
    ---------------------------------------------------------------------------EM console Audit trail (I am giving this because u can clearly understand what is happening-----------------------------------------------------
       -ReceiveFile
            -some datedetails      received file
              View XML document  (This xml contains data and structure like above  xml )
        - transformData:
            <payload>
              <InvokeService_inputvariable>
                  <part name="body">
                     <StudentList>
                         <student>
                           <name/>
                            <branch/>
                            <fathername/>
                         </student>
                   </StudentList>
              </part>
             </InvokeService_inputvariable>
    'Why I am getting like this".Is there any problem with native data format configuration.?
    Please help me out regarding this issue as I am running out my time.

    Hi syam,
    Thank you very much for your replies so far so that I have some progrees in my task.
    As you told I could have put default directory in composite.xml,but what happenes is the everyday new final subdirectory gets created  in the 'soafolder' folder.What I mean is in  the c:/soafolder/1234_xmlfiles folder, the '1234_xmlfiles' is not manually created one.It is created automatically by executing some jar.
    Basically we can't know the sub folder name until it is created by jar with its own logic. whereas main folder is same(soafolder) ever.
    I will give you example with our folder name so that it would be more convenient for us to understand.
    1) yesterday's  the folder structure :  'c:/soafolder/130731_LS' .The  '130731_LS' folder is created automatically by executing some jar file(it has its own logic to control and create the subdirectories which is not in our control).
    2) Today's folder structure :  'c:/soafolder/130804_LS. The folder is created automatically(everytime the number part(130731,130804).I think that number is indicating 2013 july 31 st like that.I have to enquire about this)is changing) at a particular time and xml files will be loaded in the folder.
    Our challenge : It is not that we can put the default or further path in composite.xml and poll the file adapter.Not everytime we have to change the path in composite.xml.The process should know the folder path (I don't know whether it is possible or not.) and  everyday and file adapter poll the files in that created subfolders.
    I hope you can understand my requirement .Please help me out in this regard.

  • Read of XML file and post to IDOC

    Hi
    I'm working on a <b>WAS620</b> and need to read an XML file from a customer, extract the fields needed and post these via IDOC ORDERS01. My problem is HOW to read the XML file? Can anyone give me the steps involved/links to examples etc - I have not processed XML files via ABAP before.
    The file is posted to a shared folder and the ABAP I am about to develop will pick up this file.
    The file is <b>NOT</b> in IDOC/XML format but the customers own format
    Hope someone can help me asap.
    Thanks all in advance
    /Bo

    Hi,
    I would like to extend this question for <b>WAS620</b> and <b>reading</b> a <b>proprietary customer specific XML</b> file/data that is <b>send via HTTP to SAP WAS</b>.
    <b>Q1</b>: What is the best way to read this HTTP sent XML data (as it is, without transformations) into ABAP?
    <b>Q2</b>: What is the appropriate handler to use in the ICF object?
    Thanks all in advance

  • Read an XML file into an ABAP program and manipulate it.

    I would like to know if it is possible to do the following in an ABAP program:
    1) Read an XML file into an ABAP internal table
    2) Call an XSLT transformation on the source file and store the results in an ABAP table.
    Is this possible to do? I have used ABAP XSLT in PI, but never in an ABAP program. I see you can use the CALL TRANSFORMATION command, but I have never used it in an ABAP program.
    Kind Regards,
    Tony.

    Check out these blogs.
    XML DOM Processing in ABAP part I -  Convert an ABAP table into XML file using SAP DOM Approach.
    XML DOM Processing in ABAP part II - Convert an XML file into an ABAP table using SAP DOM Approach.

  • How to login to a remote (FTP??) server and read an XML file?

    Hello all,
    I would like some information on how to login to a remote server using a Java program.
    The server might be a ftp server, because the client will ftp a xml file to this server, and the java program needs to login to this server and read the xml file, then convert it into a general report with headings and data from the xml file.
    How can I quickly find the API information to login to a server and read an xml file?
    If anyone knows the packages off the top of their heads, that would save me some time surfing.
    If anyone can provide me some links, code examples, or information I'd greatly be thankful.
    sharla

    You can also just use plain java.net. It supports FTP. Example:URL u = new URL("ftp://user:passwd@server/path/to/file.xml");
    InputStream in = u.openStream();
    // do what you want ...

  • Read in xml file in JPD and store

    I want to read in xml file in to jpd. I want to use xml file as properties file. and access it using xmlbeans. What is good method to this . I do not want to load file every time jpd is called.
    Message was edited by:
    rsg8
    Thanks all . I was able to handle this.

    IN the time since i posted i have solved my own query!

  • Issue with reading a xml file from xsl

    Hi,
    When I am trying to read a xml file from xsl, I am getting unwanted output.
    Following is the XSL:
    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
      <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
      <mapSources>
        <source type="XSD">
          <schema location="../xsd/B2BMarketProperties.xsd"/>
          <rootElement name="ReceipentIDType" namespace="http://www.example.org"/>
        </source>
      </mapSources>
      <mapTargets>
        <target type="XSD">
          <schema location="../xsd/B2BMarketProperties.xsd"/>
          <rootElement name="ReceipentIDType" namespace="http://www.example.org"/>
        </target>
      </mapTargets>
      <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.4.0(build 110106.1932.5682) AT [TUE DEC 03 16:06:03 EST 2013]. -->
    ?>
    <xsl:stylesheet version="1.0"
                    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
                    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
                    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
                    xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
                    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xmlns:ns0="http://www.example.org"
                    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
                    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:med="http://schemas.oracle.com/mediator/xpath"
                    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
                    xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
                    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
                    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:ora="http://schemas.oracle.com/xpath/extension"
                    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
                    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
                    exclude-result-prefixes="xsi xsl ns0 xsd bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref ora socket ldap">
      <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
      <xsl:variable name="ReceipentID" select="document('../xsd/B2BMarketProperties.xml')"/>
      <xsl:template match="/">
        <ns0:ReceipentIDType>
        <xsl:for-each select="$ReceipentID">
          <ns0:ReceipentID>
            <xsl:value-of select="$ReceipentID"/>
          </ns0:ReceipentID>
          </xsl:for-each>
        </ns0:ReceipentIDType>
      </xsl:template>
    </xsl:stylesheet>
    Following is the XML ( B2BMarketProperties.xml)
    <?xml version="1.0" encoding="UTF-8" ?>
    <ReceipentIDType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://www.example.org B2BMarketProperties.xsd"
                     xmlns="http://www.example.org">
      <ReceipentID>123</ReceipentID>
      <ReceipentID>345</ReceipentID>
    </ReceipentIDType>
    The output i am getting with this code is
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:ReceipentIDType xmlns:ns0="http://www.example.org">
        <ns0:ReceipentID>123345</ns0:ReceipentID>
    </ns0:ReceipentIDType>
    But, I need output in the following format
    <ns0:ReceipentIDType xmlns:ns0="http://www.example.org">
        <ns0:ReceipentID>123</ns0:ReceipentID>
         <ns0:ReceipentID>345</ns0:ReceipentID>
    </ns0:ReceipentIDType>
    Could you guys let me know what i am doing wrong. Any help would be appreciated.
    Thanks,

    This worked for me :
      <xsl:template match="/">
        <ns0:ReceipentIDType>
          <xsl:for-each select="document('B2BMarketProperties.xml')/*:ReceipentIDType/*:ReceipentID">
            <xsl:variable name="count" select="position()"/>
            <ns0:ReceipentID>
              <xsl:value-of select="document('B2BMarketProperties.xml')/*:ReceipentIDType/*:ReceipentID[$count]"/>
            </ns0:ReceipentID>
          </xsl:for-each>
        </ns0:ReceipentIDType>
      </xsl:template>

  • Reading a XML file in JBoss

    Hi,
    I have the code below to read a xml file into a DOM, as a standalone class it works fine, but now I want to have this class as a bean, and I don't know how to get the xml file path. I'm using JBoss.
    package meuPacote;
    import java.io.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class LerConstantes {
        public void leConstantes() {
            Document doc = parseXmlFile("infilename", false);
    System.out.println("doc " + doc);
            Element element = doc.getElementById("primeira");
            String primeira ="";
            if(element != null) primeira = doc.getElementById("primeira").hasAttribute("valorConstante")?element.getAttribute("valorConstante"):"";
            System.out.println("valor -->" + primeira);
    //    public static void main(String[] args) {
    //        Document doc = parseXmlFile("infilename.xml", false);
    //        Element element = doc.getElementById("primeira");
    //        String primeira ="";
    //        if(element != null) primeira = doc.getElementById("primeira").hasAttribute("valorConstante")?element.getAttribute("valorConstante"):"";
    //        System.out.println("valor -->" + primeira);
        // Parses an XML file and returns a DOM document.
        // If validating is true, the contents is validated against the DTD
        // specified in the file.
        public static Document parseXmlFile(String filename, boolean validating) {
            try {
                // Create a builder factory
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                factory.setValidating(validating);
                // Create the builder and parse the file
                Document doc = factory.newDocumentBuilder().parse(new File(filename));
                return doc;
            } catch (SAXException e) {
                // A parsing error occurred; the xml input is not valid
            } catch (ParserConfigurationException e) {
            } catch (IOException e) {
            return null;
    }thanks, V

    Jignesh,
    This is an XQuery forum. XDK has an XSU (XML SQL Utility) component that may help here. You can post your question to the XDK forum.
    Regards,
    Geoff

  • Error when reading a XML File

    When I am reading an XML file in a folder I am getting extra characters like squares before and after each and every character of the XML file.
    Why is this so.I thought they are spaces and trimmed it but i didnt work.I replaced thinking as escape characters and that also did not work.But when I am prionting the ASCII value of the first character of the file I am getting -17.
    Please can anyone help me out of this.
    Thanks,
    Sravanthi

    public class Example()
    File file = new File("C:/SCTMUnZip/"+files);
    System.out.println("Files inside the directory:::"+files[i]);
    String filedata = getContentsofFile(file);
    if(file.getName().contains(".xml"))
    InputStreamReader reader = new InputStreamReader(new FileInputStream("C:/SCTMUnZip/"+files[i]+"/"));
    System.out.println("Encoding Style:::"+reader.getEncoding());
    byte[] filebytes = filedata.getBytes("UTF-16");//byte[] utf8String = Encoding.UTF8.GetBytes(srcString);
    System.out.println("This is a XML File...");
    file1.setMStrFileName(files[i]);
    file1.setMPFileData(filebytes);
    //file1.setMStrFileName(files[i]);
    /*Pattern pattern = Pattern.compile("[^]");
    Matcher matcher = pattern.matcher(filedata);
    String str = matcher.replaceAll("");
    filedata = str;
    System.out.print(str);*/
    else
    System.out.println("This is a normal file...");
    file1.setMStrFileName(files[i]);
    file1.setMPFileData(filedata.getBytes());
    static public String getContentsofFile(File file)
    StringBuilder filecontents = new StringBuilder();
    try
    BufferedReader input = new BufferedReader(new FileReader(file));
    try
    String line = null; //not declared within while loop
    * readLine is a bit quirky :
    * it returns the content of a line MINUS the newline.
    * it returns null only for the END of the stream.
    * it returns an empty String if two newlines appear in a row.
    while (( line = input.readLine()) != null){
    filecontents.append(line);
    filecontents.append(System.getProperty("line.separator"));
    finally {
    input.close();
    catch (IOException ex){
    ex.printStackTrace();
    return filecontents.toString();
    The files in the folder are log.txt and output.xml(has UTF-16 as the encoding style in the first line).log.txt is read fine but output.xml is not.

  • I need for a simple example of  reading a xml file using jdom

    Hello
    I have been looking for a simple example that uses Jdom to read am xml file and use the information for anything( ), and I just can't find one.since I'm just beggining to understand how things work, I need a good example.thanks
    here is just a simple cod for example:
    <xmlMy>
         <table>
              <item name="first" value="123" createdDate="1/1/90"/>
              <item name="second" value="456" createdDate="1/4/96"/>
         </table>
         <server>
              <property name="port" value="12345"/>
              <property name="maxClients" value="3"/>
         </server>
    </xmlMy>Dave

    Hi,
            FileInputStream fileInputStream = null;
            try {
                fileInputStream = new FileInputStream("my_xml_file.xml");
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } finally{
                if (fileInputStream == null) return;
            SAXBuilder saxBuilder = new SAXBuilder();
            saxBuilder.setEntityResolver(new EntityResolver() {
                public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
                    return new InputSource(new StringReader(""));
            Document document = null;
            try {
                document = saxBuilder.build(fileInputStream);
            } catch (JDOMException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                if (document == null) return;
            Element element = document.getRootElement();
            System.out.println(element.getName());
            System.out.println(element.getChild("table").getName());

  • Reading an XML file from a package .....

    I m trying to read an xml file from a package. The XML file is located on desktop (not on unix system). if i mention the path of the file in a package, is it sufficient ???. OR do i need to CREATE DIRECTORY in oracle and mention the file path in this directory ???
    I have granted CREATE directory permissions...
    If not any suggestion or advice is great ???
    Thank you!!

    BANNER
    1     Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    2     PL/SQL Release 11.1.0.6.0 - Production
    3     CORE     11.1.0.6.0     Production
    4     TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    5     NLSRTL Version 11.1.0.6.0 - Production
    Thank you !!!

  • Reading an xml file from a jar file

    Short question:
    Is it possible to read an xml file from a jar file when the dtd is
    placed inside the jar file? I am using jdom (SAXBuilder) and the default
    sax parser which comes with it.
    Long Question:
    I am trying to create an enterprise archive file on Weblogic 6.1. We
    have a framework that is similar to the struts framework which uses it's
    own configuration files
    I could place the dtd files outside the jar ear file and specify the
    absolute path in an environment variable in web.xml which is
    configurable through the admin console.
    But I want to avoid this step and specify a relative path within the jar
    file.
    I have tried to use a class which implements the entityresolver as well
    as try to extend the saxparser and set the entity resolver within this
    class explicitly, but I always seem to sun into problems like:
    The setEntityresolver method does not get called or there is a
    classloader problem. i.e. JDOM complains that it cannot load My custom
    parser which is part of the application
    Vijay

    Please contact the main BEA Support team [email protected]
    They will need to check with product support to determine
    the interoperatablity of Weblogic Server with these other
    products.

  • Reading an XML file stored in Oracle

    Is it possible to read an xml file stored in Oracle via Oracle methods?

    If by "read" you mean "read as text", then you can just select the document as a CLOB and return it.
    If by "read" you mean "read and parse", then you can use the Oracle XML Parser for PL/SQL to parse the CLOB into a DOM structure.
    My Building Oracle XML Applications book has lots of examples of doing this, but especially in chapter 5, "Processing XML with PL/SQL".
    Steve Muench
    Development Lead, Oracle XSQL Pages Framework
    Lead Product Manager for BC4J and Lead XML Evangelist, Oracle Corp
    Author, Building Oracle XML Applications
    null

  • Reading my Xml file in Unity using C#

    Hi, i have to read a xml file like this:
    <UIs>
    <UI>
    <Titolo>
    <Ita>
    Mitocondri
    </Ita>
    <English>
    Mitochondrion
    </English>
    </Titolo>
    <Corpo>
    <Ita>
    I mitocondri sono gli organelli che producono ATP all'interno della cellula,aggiungine di nuovi per aumentare la produzione di ATP
    </Ita>
    <English>
    Mitochondrion
    </English>
    </Corpo>
    <Price>
    120
    </Price>
    <MaxNumber>
    1
    </MaxNumber>
    </UI>
    <UIs>
    How can i make a simple xml reader in c# to read this structure?
    Thanks!

    Try this.  The code writes your sample XML and then reads it back
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data;
    using System.Xml;
    using System.Xml.Serialization;
    using System.Xml.Schema;
    using System.IO;
    namespace ConsoleApplication1
    class Program
    const string FILENAME = @"c:\temp\Test.xml";
    static void Main(string[] args)
    UIs uIs = new UIs()
    uI = new UI()
    titolo = new Titolo()
    Ita = "Mitocondri",
    english = "Mitochondrion"
    corpo = new Corpo()
    ita = "I mitocondri sono gli organelli che producono ATP all'interno della cellula,aggiungine di nuovi per aumentare la produzione di ATP",
    english = "Mitochondrion"
    price = 120,
    maxNumber = 1
    XmlSerializer serializer = new XmlSerializer(typeof(UIs));
    StreamWriter writer = new StreamWriter(FILENAME);
    XmlSerializerNamespaces _ns = new XmlSerializerNamespaces();
    _ns.Add("", "");
    serializer.Serialize(writer, uIs, _ns);
    writer.Flush();
    writer.Close();
    writer.Dispose();
    XmlSerializer xs = new XmlSerializer(typeof(UIs));
    XmlTextReader reader = new XmlTextReader(FILENAME);
    UIs newUIs = (UIs)xs.Deserialize(reader);
    [XmlRoot("UIs")]
    public class UIs
    [XmlElement("UI")]
    public UI uI { get; set; }
    [Serializable, XmlRoot("UI")]
    public class UI
    [XmlElement("Titolo")]
    public Titolo titolo { get; set; }
    [XmlElement("Corpo")]
    public Corpo corpo { get; set; }
    [XmlElement("Price")]
    public int price { get; set; }
    [XmlElement("MaxNumber")]
    public int maxNumber { get; set; }
    [Serializable, XmlRoot("Titolo")]
    public class Titolo
    [XmlElement("Ita")]
    public string Ita { get; set; }
    [XmlElement("English")]
    public string english { get; set; }
    [Serializable, XmlRoot("Corpo")]
    public class Corpo
    [XmlElement("Ita")]
    public string ita { get; set; }
    [XmlElement("English")]
    public string english { get; set; }
    jdweng

Maybe you are looking for

  • GL Accounts Opening Balance Window

    HI Experts,              Right Now I want to manually enter the opening balances of G/L accounts.I am working on the project for a Service Industry who don't maintain any Inventory (Non-Perpectual Inventory). I am having some doubts after these steps

  • Rejected email reported in Postmaster

    Hi, I am having a problem where user cannot send to a mailing list group. All the email has been rejected. FYI, # ./imsimta version iPlanet Messaging Server 5.2 HotFix 2.10 (built Dec 26 2005) libimta.so 5.2 HotFix 2.10 (built 11:35:08, Dec 26 2005)

  • Raw file rendering problems with Canon EOS 5D in Aperture 3

    Since upgrading to Aperture 3, I have had serious problems with the rendering of Canon EOS 5D (not Mark II/III) RAW files. With Aperture 2, both the preview and full-sized images looked basically the same as the original images as displayed on the ca

  • OpenGL Graphic Apps

    Does the graphic card in the PowerBook 12" supports OpenGL applications? If not, what are my options?

  • Adobe 9.0 Pro deleting signature field

    How do you delete a signature field in adobe 9.0 pro or standard? I can clear the signature, but not delete it entirely. I need to show engineers how to do this in case they create it the wrong size or in the wrong place. In adobe 7.0 pro and standar