Module Adapter - String Change in XML

Module Adapter
I have been reading "How to Create Modules for the J2EE Adapter Engine" and am trying to implement an adapter module to change a few strings in the message.
I understand I can grab the XI message using the getPrincipalData such as:
// get the XI message from the environment
Message msg = (Message) inputModuleData.getPrincipalData();
and return the message using:          
// provide the XI message for returning
inputModuleData.setPrincipalData(msg);
What is the proper method of searching for strings inside this message and changing a value. We have tried the approach of using XSLT and Java maps to change values but the items we need to change need to occur at the adapter level. Any sample code around changing payload information in an adapter module would be appreciated.
Regards

Hi,
The methods which you use with SAX parser are:
1) Start of the document(startDocument)
2) start of the element(startElement)
3) end of the element(endElement)
4) end of the document(endDocument)
5) chars()
Build your logic using these. These blogs should help you in the process:
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
You could write the java code in the process method of your bean or you could call the class from the process method.
What exactly do you mead by testng the adapter module? You could test your the java code i.e the SAX parser as you would test any standalone java code. You would be using the same in your bean.
Regards,
Chandra

Similar Messages

  • Throw Error in Module Adapter EJB

    Hi experts,
    In order to make some validations when getting file in File Adapter, was developed a EJB Module Adapter. When the validation failed, it must to be generate a throw error with a text that appears in Runtime workbench.
    throw new ModuleException("Error al crear objeto Archivo para procesar el legacy: "+legacy);
    But, it doens't happen. In Runtime workbench I just can see a Exception null . 
    Follow Below the Java Code of Module EJB:
    package clasesSox;
    import java.io.IOException;
    import java.io.InputStream;
    import java.math.BigDecimal;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;
    import java.util.Map;
    import java.util.StringTokenizer;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    import com.sap.aii.af.mp.module.ModuleException;
    @author martin.j.rodriguez
    public class Archivo extends XMLParser {
         private Log log = LogFactory.getLog(Archivo.class);
         private Config config;
        private String nombre, tipoSistema, pais;
        private Date fecha;
        //private boolean procesado;
         //private org.xml.sax.XMLReader xr;
         private double totimp, importeParcial;
        private String buscaTOTIMP, regImporte, buscaTOTLIN;
        private String [] tags;
        private InputStream inputStream;
        private int totlin, regCuenta;
        public Archivo(InputStream is, String legacy) throws ModuleException {
             super();
             Map properties = getConfig().getConfig(legacy);
              if (properties == null) {
                   if (log.isErrorEnabled()){
                        log.error("Error al crear objeto Archivo para procesar el legacy: "legacy" - No se encontro la configuración.");
                   throw new ModuleException("Error al crear objeto Archivo para procesar el legacy: "+legacy);
              this.buscaTOTIMP = (String)properties.get(Config.CAMPO_IMPORTE_TOTAL);
              this.regImporte =  (String)properties.get(Config.CAMPO_IMPORTE);
              this.buscaTOTLIN = (String)properties.get(Config.CAMPO_LINEAS_TOTAL);
              String tagstosearch = (String)properties.get(Config.CAMPO_LINEAS_CONTAR);
              StringTokenizer st = new StringTokenizer(tagstosearch, ",");
              tags = new String[st.countTokens()];
              int i=0;
              while(st.hasMoreTokens()){
                   String token = st.nextToken();
                   tags[i++] = token.trim();
              setInputStream(is);
        public List validaArchivo() throws ParserConfigurationException, SAXException, IOException {
              regCuenta = 0;
             importeParcial = 0;
              DefaultHandler handler = this;
              SAXParserFactory factory = SAXParserFactory.newInstance();
              SAXParser saxParser = factory.newSAXParser();
              saxParser.parse(inputStream, handler);
              String s = "";
              roundValues();
              String stotimp = new BigDecimal(totimp).setScale(2, BigDecimal.ROUND_HALF_UP).toString();
              String simporteParcial = new BigDecimal(importeParcial).setScale(2, BigDecimal.ROUND_HALF_UP).toString();
              if (log.isDebugEnabled()){
                   log.debug("Resultados: TOTIMP: "stotimp" - CONTEO: "+simporteParcial);
                   log.debug("Resultados: TOTLIN: "totlin" - CONTEO: "+regCuenta);
              List results = new ArrayList();
              if (totimp != importeParcial) {
                   s = "Error al contar el total del importe, deberia ser: "stotimp" y el calculado es: "+simporteParcial;
                   if (log.isDebugEnabled()){
                        log.debug(s);
                   results.add(s);
              if (totlin != regCuenta) {
                   s = "Error al contar el total del lineas, deberia ser: "totlin" y el calculado es: "+regCuenta;
                   if (log.isDebugEnabled()){
                        log.debug(s);
                   results.add(s);
              return results;
         private void roundValues() {
              totimp = roundValue(totimp);
              importeParcial = roundValue(importeParcial);
    redondea un numero a 2 decimales
         private double roundValue(double d) {
              BigDecimal bd = new BigDecimal(d);
              bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP);
              return bd.doubleValue();
         public void startElement(String namespaceURI, String lName, String qName, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException {
              String etiqueta = getTagName(qName, lName);
              //niveles.add(etiqueta);
              // Cuenta registros
              for (int i = 0;i< tags.length; i++){
                   if (etiqueta.equals(tags+)){
                        regCuenta++;
                        break;
         public void endElement(String namespaceURI, String lName, String qName)     throws org.xml.sax.SAXException     {
              String etiqueta = getTagName(qName, lName);
              //niveles.remove(niveles.size() - 1);
              // set valor totlin
              if (buscaTOTLIN.equals(etiqueta)){
                   totlin = parseInt(valor);
              // set valor totimp
              if (buscaTOTIMP.equals(etiqueta)){
                   totimp = parseDouble(valor);
              // suma importe parcial
              if (regImporte.equals(etiqueta)){
                   importeParcial += parseDouble(valor);
        public InputStream getInputStream() {
            return inputStream;
        public void setInputStream(InputStream texto) {
            this.inputStream = texto;
        public String getNombre() {
            return nombre;
        public void setNombre(String nombre) {
            this.nombre = nombre;
        public String getTipoSistema() {
            return tipoSistema;
        public void setTipoSistema(String tipoSistema) {
            this.tipoSistema = tipoSistema;
        public String getPais() {
            return pais;
        public void setPais(String pais) {
            this.pais = pais;
        public java.util.Date getFecha() {
            return fecha;
        public void setFecha(java.util.Date fecha) {
            this.fecha = fecha;
         public static void main(String args[]) {
                   String fileName = "FI_MAS_SAP_RENBAN_####_AAAAMMDD_HHMMSS.TXT";
                   java.util.StringTokenizer st = new java.util.StringTokenizer(fileName, "_");
                   for (int i = 0; i < 5; i++)
                        st.nextToken();
                   String anioMes = st.nextToken();
                   if (anioMes != null)
                        if (anioMes.length() > 5) {
                             System.out.println(anioMes);
                             System.out.println(anioMes.substring(0, 4) + " " + anioMes.substring(4, 6));
         private double parseDouble(String number){
              if (number == null || number.trim().length()==0 || number.trim().equals("/"))
                   return 0;
              // remuevo los 0 a la izquierda que afectan al parseint
              number = number.trim().replaceAll("^0+","");
              number = number.replaceAll(",",".");
              double result = 0;
              try {
                   result = Double.parseDouble(number);
              catch (NumberFormatException nfe){
                   System.err.println("Error parseando numero "+number);
              return result;
         private int parseInt(String number){
              if (number == null || number.trim().length()==0 || number.trim().equals("/"))
                   return 0;
              // remuevo los 0 a la izquierda que afectan al parseint
              number = number.trim().replaceAll("^0+","");
              number = number.replaceAll(",",".");
              int result = 0;
              try {
                   result = Integer.parseInt(number);
              catch (NumberFormatException nfe){
                   System.err.println("Error parseando numero "+number);
              return result;
    Carga la configuracion
    @return
         protected Config getConfig(){
              if (config == null){
                   ConfigParser cp = new ConfigParser();
                   config = cp.readConfig();
              return config;
    Could anyone help me about this problem ?
    Thanks in advance.+

    Hi,
    do u think, u will get the error text in the RWB ? I don't think so, it will provide the output in the RWB.
    The output of the Adapter module is nothing but XI -XML message. So this will not come
    check it out for the how to work on Adapter Modules-
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e
    Hope this helps,
    Regards,
    Moorthy

  • Which are function modules used to convert into XML format in SAP 4.6c Ver

    which are function modules used to convert into XML format in SAP 4.6c Ver

    Hi,
    check this program , I think this will help you
    TYPE-POOLS: ixml.
    TYPES: BEGIN OF xml_line,
    data(256) TYPE x,
    END OF xml_line.
    data : itab like catsdb occurs 100 with header line.
    data : file_location type STRING.
    data : file_name like sy-datum.
    data : file_create type STRING.
    file_name = sy-datum .
    file_location = 'C:\xml\'.
    concatenate file_location file_name into file_create.
    concatenate file_create '.XML' into file_create.
    DATA: l_xml_table TYPE TABLE OF xml_line,
    l_xml_size TYPE i,
    l_rc TYPE i.
    select * from catsdb into table itab.
    append itab .
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
    EXPORTING
    I_FIELD_SEPERATOR =
    I_LINE_HEADER =
    I_FILENAME =
    I_APPL_KEEP = ' '
    I_XML_DOC_NAME =
    IMPORTING
    PE_BIN_FILESIZE = l_xml_size
    TABLES
    i_tab_sap_data = itab
    CHANGING
    I_TAB_CONVERTED_DATA = l_xml_table
    EXCEPTIONS
    CONVERSION_FAILED = 1
    OTHERS = 24
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD cl_gui_frontend_services=>gui_download
    EXPORTING
    bin_filesize = l_xml_size
    filename = file_create
    filetype = 'BIN'
    CHANGING
    data_tab = l_xml_table
    EXCEPTIONS
    OTHERS = 24.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    write : 'INTERNAL TABLE DATA IS SUCCESSFULLY DOWNLOADED TO LOCATION', file_create .
    Thanks.

  • Converting SQL Server text field containing XML string to XI XML via JDBC

    Hello
    My client has a SQL Server database containing a field of type Text which contains an XML string e.g.
    <DispatchJob> <DispatchDateTime>2003-09-29T13:29:15</DispatchDateTime> <AssignedFSE>F118</AssignedFSE> <DispatchJobPurchase> <DealerID>14C5</DealerID> <DateOfPurchase>1997-10-01T00:00:00</DateOfPurchase> </DispatchJob>
    I am using JDBC to access this but could someone please recommend the best and easiest solution for converting this string to XI XML for subsequent mapping to BAPI or IDOC or ABAP Proxy and transmission to SAP. There are other fields as well in the database table so thoughts at the moment are to use a normal graphical message mapping followed by an XSL mapping. Will an XSL mapping be able to do this and if so is that the best solution?
    Also I need to do the reverse of this and take fields coming from SAP via BAPI,IDOC etc. and convert them to a single database table field as an XML string also via the JDBC adapter. What is the best way to do this. Could it be done simply with functions in the graphical mapping e.g. concatenate?
    Thank you in advance.
    Trevor

    Hi Michal
    Thanks for the prompt reply.
    I was anticipating XSLT for reading from the SQL Server database and converting the XML string.
    But how would you convert the individual fields from SAP into a single field as an XML string for storing in the SQL Server database? What approach would you use?
    Regards
    Trevor

  • How to Change the XML data that got stuck up in XI

    Hi,
    I am executing a scenario which sends the data from HTTP client>Xi->SAP(R/3 4.6).We are queuing the messages in XI, through QoS EOIO.Sender side we have configured the HTTP adapter and on receiver side we have configured RFC adapter.RFC at receiver side throws an exception, if I try to call rfc from XI by sending  wrong data to it from HTTP client.The message which is failed gets stuck up in the queue , whose status will be shown as System Error.So, No messages will be further processed from that queue.
    Our Requirement is, We need to manually change the xml file which is  failed while trying to post data in to SAP.Could any one help me  to find where the Failed xml file gets stored in XI and how can we change the file .
    Regards,
    Kiran kumar.

    Mario,
    This is possible from SP 19 onwards...
    Have a look @
    /people/gourav.khare2/blog/2007/02/28/sapxi--message-editing-150-responsibility-and-liability-150-sp19
    Also, the comments in the blog. Really good
    http://help.sap.com/saphelp_nw04/helpdata/en/43/4a576b5b7430f3e10000000a11466f/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/43/4a576b5b7430f3e10000000a11466f/frameset.htm
    Regards,
    Jai Shankar

  • Module Context - Module adapter development question

    Hi,
    I've been using the method moduleContext.getContextData(nameParameterChannel) to get values from the communication channel for my custom modules adapter.
    Reading the [API|http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/af/lib/mp/module/ModuleContext.html] there is another method for which I'm not sure what it does:
    --> getContextData(String name, boolean fallback)
    Returns a value of a module configuration parameter and if fallback is true and the parameter cannot be found in the module configuration it is tried to read it from the channel configuration data
    With the usual method --> getContextData(String name), I've been always reading from the channel configuration data (name being the name of the parameter and the string returned being the value).
    So what does that method above do? That place "module configuration" in contrast to "channel configuration data" is not clear to me.
    Thanks!

    Closing (not solution yet)

  • See Burger Error in BICMODULE-module:Adapter call failed. Reason: null

    Hello All,
    Scenario IDOC to File using Seeburger BIC problems in in my receiver adapter when converting from XML to EDI.
    Error is:
    "Message processing failed. Cause: Error in BICMODULE-module:Adapter call failed. Reason: null"
    The Seeburger modules used in my receiver adapter:
    1     localejbs/CallBicXIRaBean     Local Enterprise Bean     BIC_MT
    2     localejbs/CallBicXIRaBean     Local Enterprise Bean     BIC
    3     localejbs/Seeburger/FileStore     Local Enterprise Bean     ARCHIVE_EDI
    4     CallSapAdapter     Local Enterprise Bean     0
    with following module configurations
    BIC     destDelimiter     @http://seeburger.com/xi/bic/destDelimiter
    BIC     destSourceMsg     source
    BIC     destTargetMsg     MainDocument
    BIC     dynamicConfiguration     true
    BIC     newLine     true
    BIC     useAttribIfSet     true
    BIC_MT     PartnerLookup     on
    BIC_MT     destSourceMsg     MainDocument
    BIC_MT     destTargetMsg     MainDocument1
    BIC_MT     mappingName     XML_Generic_ANSI_X12_to_DB_MT_OUT
    BIC_MT     saveSourceMsg     source
    Can some one tell me why there is an Error and what additional module configurations it requires .
    Thank you,

    Hi,
    If possible go to mapping in BIC designer Tool and execute the same by passing your payload there...
    if you encounter any errors then there might be a problem with mapping developed...or can be payload..
    Also check the parameter used for destSourceMsg source ...is that the source message which contains the payload ?
    HTH
    Rajesh

  • Changing the XML Structure in "Submit as XML"

    Dear all,
    We have two PDF Templates which are submitted via a WebService using Submit as XML. For both templates we need the same structured XML output.
    Form 1 has the hierarchy like this (all subforms):
    Company
    Subsdiary
    Responsibles
    Footer
    so the xml looks like
    <creditrequest>
    <company>...</company>
    <subsdiary>...</subsdiary>
    <responsible>...</responsible>
    <footer>...</footer>
    </creditrequest>
    Form 2 has the hiearchy like this (all subforms):
    Responsibles
    Subsidiary
    Company
    Footer
    and the xml looks like
    <creditrequest>
    <responsible>...</responsible>
    <subsdiary>...</subsdiary>
    <company>...</company>
    <footer>...</footer>
    </creditrequest>
    So my question is how can influence the XML output order without changing the PDF hiearchy. This way I can change the XML output for Form 1 or Form 2 and both files would have the same XML structure to submit.
    I have checked the presubmit event and the javascript API to change XML string programmaticly but I couldn't find any possiblity to read/write the XML to submit.
    Thanks,
    Koray

    You can use JDOM and DOM. They are classes that load the XML File on memory and then you can modify it. I strongly recommend JDOM.

  • Module Adapter XI

    Hi Guys,
      I need yours help for creating a Module Adapter. In my scenario I have to implement a Java Module that receive a Microsoft Word document. I must to convert this file en Base64 format and push in the principalData.
      The first problem that I saw is when I have captured the file xx.doc in inputModuleData.getPrincipalData is null.
      The suplementary data contains the fileName and FileCompleted parameters with the fileName and FileCompleted have the value 1.
       How can I get the binary data from a java object?
       I don't know any SAP site where I can see the API for Module Adapter.
    Thanks
    Ivá

    Hi,
    Check some links on Module adapter.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac25e74c4c81
         http://help.sap.com/saphelp_nw04/helpdata/en/8b/895e407aa4c44ce10000000a1550b0/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/12/f9bb2fe604a94cbcb4c50dc510b799/content.htm
    /people/michal.krawczyk2/blog/2006/10/09/xi-dynamic-configuration-in-adapter-modules--one-step-further
         /people/gowtham.kuchipudi2/blog/2006/01/04/testing-sample-adapter
    /people/john.ta2/blog/2006/12/20/to-create-or-not-to-create-an-sap-xi-adapter
         https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac25e74c4c81
    Exchange Infrastructure How-to Guides for SAP NetWeaver 2004 [original link is broken]
    /people/sap.user72/blog/2005/07/04/read-excel-instead-of-xml-through-fileadapter
    /people/sap.user72/blog/2005/07/15/copy-a-file-with-same-filename-using-xi
    PPT: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e21106cc-0c01-0010-db95-dbfc0ffd83b3
    How to Guide: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e
    Regards,
    Phani

  • How to get string value from xml in JSF??

    In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF

    Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
    JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization.

  • How to write a string into an XML

    I wrote a web service to receive a string and write to Oracle Application Server as XML Document. But It is not writing anything. Below is writer program. What do I need to add to make it work
    public class Writer
    public Writer()
    } public void WriteHabFile(String out, String fileName)
    XMLDocument doc = new XMLDocument();
    try
    XMLPrintDriver output=new XMLPrintDriver(new FileOutputStream(new File(fileName)));
    output.setEncoding("utf-8");
    output.printDocument(doc);
    output.close();
    catch (Exception e)
    System.out.println(e.toString());
    public void WriteLanFile(String out2, String fileName2)
    XMLDocument doc = new XMLDocument();
    try
    XMLPrintDriver output=new XMLPrintDriver(new FileOutputStream(new File(fileName2)));
    output.setEncoding("utf-8");
    output.printDocument(doc);
    output.close();
    catch (Exception e)
    System.out.println(e.toString());
    Any help would be greatly appreciated.

    Why don't you try something like:
    public class Writer {
    public Writer(){}
    public void WriteHabFile(String out, String fileName) {
         oracle.xml.parser.v2.DOMParser parser = new oracle.xml.parser.v2.DOMParser();
         try {
              parser.parse(new BufferedReader(new StringReader(out)));
         catch(XMLParseException xe) {
              // Do Something
         catch(SAXException se) {
              // Do Something
         catch(IOException ie) {
              // Do Something
         XMLDocument doc = parser.getDocument();
    try {
    XMLPrintDriver output=new XMLPrintDriver(new FileOutputStream(new File(fileName)));
    output.setEncoding("utf-8");
    output.printDocument(doc);
    output.close();
    catch (Exception e)
    System.out.println(e.toString());
    public void WriteLanFile(String out2, String fileName2) {
         oracle.xml.parser.v2.DOMParser parser = new oracle.xml.parser.v2.DOMParser();
         try {
              parser.parse(new BufferedReader(new StringReader(out)));
         catch(XMLParseException xe) {
              // Do Something
         catch(SAXException se) {
              // Do Something
         catch(IOException ie) {
              // Do Something
         XMLDocument doc = parser.getDocument();
    try {
    XMLPrintDriver output=new XMLPrintDriver(new FileOutputStream(new File(fileName2)));
    output.setEncoding("utf-8");
    output.printDocument(doc);
    output.close();
    catch (Exception e)
    System.out.println(e.toString());
    Hope this helps,
    Mark Brown

  • File Adapter and reading all XML files from direcotry

    Problem occurs on PI 7.1
    I defined sender file adapter. File name mask is: "*.xml" to read all XML messages from directory.
    Quality of service is: Exactly One.
    Poll Interval: 30
    Retry interval: 30
    Processing mode: Archive with option "Add Timestamp".
    Processing sequence: by name.
    I though that with above configuration my File Adapter will be reading folder for all coming XML files. But  somehow it is reading XMLs only when I'm activating it in Integration Builder.
    Any idea what can cause such strange problem?

    Hi Tomasz,
    As per my understanding, you need to activate the file adapter for reading the XML files on your directory. Right?
    If that is the case, then the issue might be with the Cache.
    1. Clear the cache from the Integration Builder.
    2. Check in SXI_CACHE whether there are any issues. Click on Delta Cache refresh to find out if there are any cache related issues.
    Thanks,

  • How to Parse a string into an XML DOM ?

    Hi,
    I want to parse a String into an XML DOM. Not able to locate any parser which supports that. Any pointers to this?

    Download Xerces from xml.apache.org. Place the relevant JAR's on your classpath. Here is sample code to get a DOM document reference.
    - Saish
    public final class DomParser extends Object {
         // Class Variables //
         private static final DocumentBuilder builder;
         private static final String JAXP_SCHEMA_LANGUAGE =
             "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
         /** W3C schema definitions */
         private static final String W3C_XML_SCHEMA =
             "http://www.w3.org/2001/XMLSchema";
         // Constructors //
         static {
              try {
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   factory.setNamespaceAware(true);
                   factory.setValidating(true);
                   factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                   builder = factory.newDocumentBuilder();
                   builder.setErrorHandler(new ErrorHandler() {
                       public void warning(SAXParseException e) throws SAXException {
                           System.err.println("[warning] "+e.getMessage());
                       public void error(SAXParseException e) throws SAXException {
                           System.err.println("[error] "+e.getMessage());
                       public void fatalError(SAXParseException e) throws SAXException {
                           System.err.println("[fatal error] "+e.getMessage());
                           throw new XmlParsingError("Fatal validation error", e);
              catch (ParserConfigurationException fatal) {
                   throw new ConfigurationError("Unable to create XML DOM document parser", fatal);
              catch (FactoryConfigurationError fatal) {
                   throw new ConfigurationError("Unable to create XML DOM document factory", fatal);
         private DomParser() {
              super();
         // Public Methods //
         public static final Document newDocument() {
              return builder.newDocument();
         public static final Document parseDocument(final InputStream in) {
              try {
                   return builder.parse(in);
              catch (SAXException e) {
                   throw new XmlParsingError("SAX exception during parsing.  Document is not well-formed or contains " +
                        "illegal characters", e);
              catch (IOException e) {
                   throw new XmlParsingError("Encountered I/O exception during parsing", e);
    }- Saish

  • How can I parse an XML string, (not an XML file)?

    Hi,
    I am using Xerces2 Java Parser 2.4.0,
    I wanta parse an XML string, not an XML file, but
    in the Parser class there is only following methods:
    parse(InputSource source)
    parse(java.lang.String systemId)
    thanks

    hi
      InputSource is = new InputSource(new ByteArrayInputStream(xmlSrc.getBytes()));
      HTH
    vasanth-ct

  • Change ?xml version="1.0"? to ?xml version="1.0" encoding="UTF-8" ?

    is it possible with SYS_XMLGEN and xmlelement
    to change the xml tag <?xml version="1.0"?> and add a encoding attr like <?xml version="1.0" encoding="UTF-8" ?>
    when making xmltype from a query?

    select xmltype( '<?xml version="1.0" encoding="UTF-8" ?>' ||
                    xmlelement( "xx", dummy ).getclobval()
                  ).getclobval()
    from dualCode like this will result in a CLOB, which uses the characterset of the database and NOT the characterset specified in the encoding of the XML-header
    Anton

Maybe you are looking for

  • Contacts search for cisco Jabber for Windows & MAC

    Hello, Please assist on given below query !! System Deatails of CUCM & IM Presence Server CUCM: 1>  System version: 9.1.1.20000-5 2>  VMware Installation: 2 vCPU Intel(R) Xeon(R) CPU X5650 @  2.67GHz, disk 1: 80Gbytes, 4096Mbytes RAM 3> Physical Serv

  • Black flashes in my sequence

    PLEASE HELP! I'm getting flashes in some of my sequence. It's a 720, 23.976fps sequence from a dlsr. it's only happening when I export. in the timeline it looks fine. Can you help?

  • Hide Repeating values

    Hi all, In my scenario, I have Cost Center and Cost Elements in Rows and Time in column. When I display my schedule, it displays the Cost Center name in all the rows which has Cost Elements in it. How can I hide those? For ex: CC1   CE1    ....      

  • How can I find a text box with a specific word in it ?

    Hi, I have hundreds of settlement names on a map created with the text tool. How can I search on the name of one of them and find it on my map ? I am with FH9 but the method would no doubt be backwards compatible from MX. If it isnt I would launch MX

  • Print Invoice "Object Blocked"

    when the user trying to print the invoice it is givng an error that the object is blocked. the error contains invoice number and the application  3 and output type. i am not able to think where to start investigation, thanks for your support