DOM Parsing problems... (newbie in trouble)

I am trying to get a DOM Parser contruct a DOM Object from an XML file... I am having trouble getting the code validate against my XML Schema: <p>
<?xml version="1.0" encoding="UTF-8"?> <
<!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by Fedro E. Ponce de Leon Luengas (ASI Consulores, S.A. de C.V.) -->
<xs:schema targetNamespace="http://palaciohierro.com.mx/mde/expe" xmlns="http://palaciohierro.com.mx/mde/expe" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="existencia-peticion" type="epType">
<xs:annotation>
<xs:documentation>Peticion de existencias para la Mesa de Eventos Web</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="epType">
<xs:annotation>
<xs:documentation>peticion de existencia</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="articulo" type="articuloType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="articuloType">
<xs:annotation>
<xs:documentation>articulo</xs:documentation>
</xs:annotation>
<xs:attribute name="id_articulo" type="IdentifierType" use="required"/>
<xs:attribute name="sku" type="skuType" use="required"/>
</xs:complexType>
<xs:simpleType name="IdentifierType">
<xs:annotation>
<xs:documentation>identificador</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:long">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="999999999999999999"/>
<xs:totalDigits value="22"/>
<xs:fractionDigits value="0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="skuType">
<xs:annotation>
<xs:documentation>sku</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="11"/>
<xs:maxLength value="20"/>
<xs:pattern value="\d{11,20}"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
taking this sample XML file:
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XML Spy v4.4 U (http://www.xmlspy.com)-->
<expe:existencia-peticion xmlns:expe="http://palaciohierro.com.mx/mde/expe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://palaciohierro.com.mx/mde/expe
C:\oracle\Oracle9iDS\jdev\mywork\testCompra\MesaEventos\src\ph\mesaeventos\schema\existencia-peticion.xsd">
<articulo id_articulo="450" sku="12245110021"/>
<articulo id_articulo="15" sku="45421213223"/>
<articulo id_articulo="12" sku="121131231858"/>
<articulo id_articulo="74" sku="4101031234545"/>
<articulo id_articulo="871" sku="022324563212"/>
</expe:existencia-peticion>
with the following code:
public Document getDOM( String existenciapeticionXML ) throws Exception
// Obtain parser instance and parse the document
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating( true );
factory.setNamespaceAware( true );
DocumentBuilder builder = factory.newDocumentBuilder();
byte buf[] = existenciapeticionXML.getBytes();
ByteArrayInputStream stream = new ByteArrayInputStream( buf );
Document doc = builder.parse( stream );
return doc;
I am getting the following Exception:
oracle.xml.parser.v2.XMLParseException: Element 'expe:existencia-peticion' used but not declared.
void oracle.xml.parser.v2.XMLError.flushErrors()
XMLError.java:145
void oracle.xml.parser.v2.NonValidatingParser.parseDocument()
NonValidatingParser.java:263
void oracle.xml.parser.v2.XMLParser.parse(org.xml.sax.InputSource)
XMLParser.java:141
org.w3c.dom.Document oracle.xml.jaxp.JXDocumentBuilder.parse(org.xml.sax.InputSource)
JXDocumentBuilder.java:96
org.w3c.dom.Document javax.xml.parsers.DocumentBuilder.parse(java.io.InputStream)
DocumentBuilder.java:119
org.w3c.dom.Document ph.mesaeventos.mesa.xml.ExistenciaPeticionDOM.getDOM(java.lang.String)
ExistenciaPeticionDOM.java:26
void ph.mesaeventos.mesa.xml.Test.main(java.lang.String[])
Test.java:38
What am I doing wrong? I am clueless... please help!
Thanks,

I finally managed to make it work.... well quite!
Having an XML Doc like this:
<?xml version="1.0"?>
<existencia-peticion xmlns = "http://palaciohierro.com.mx/mde/expe">
<articulo id_articulo="10" sku="00000000010"></articulo>
<articulo id_articulo="11" sku="00000000011"></articulo>
<articulo id_articulo="12" sku="00000000012"></articulo>
<articulo id_articulo="13" sku="00000000013"></articulo>
</existencia-peticion>
with an schema like:
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://palaciohierro.com.mx/mde/expe"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:expe="http://palaciohierro.com.mx/mde/expe"
elementFormDefault="qualified">
<annotation>
<documentation xml:lang="es">
Esquema de peticion de existencias para la Mesa de Eventos Web
Copyright 2002 palaciodehierro.com.mx. Todos los derechos reservados.
</documentation>
</annotation>
<element name="existencia-peticion" type="expe:epType">
<unique name="id_articulo">
<selector xpath="expe:articulo"/>
<field xpath="@id_articulo"/>
</unique>
<unique name="sku">
<selector xpath="expe:articulo"/>
<field xpath="@sku"/>
</unique>
</element>
<complexType name="epType">
<annotation>
<documentation>peticion de existencias</documentation>
</annotation>
<sequence>
<element name="articulo" type="expe:articuloType" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="articuloType">
<annotation>
<documentation>articulo</documentation>
</annotation>
<attribute name="id_articulo" type="expe:IdentifierType" use="required"/>
<attribute name="sku" type="expe:skuType" use="required"/>
</complexType>
<simpleType name="IdentifierType">
<annotation>
<documentation>identificador</documentation>
</annotation>
<restriction base="long">
<minInclusive value="0"/>
<maxInclusive value="999999999999999999"/>
<totalDigits value="18"/>
<fractionDigits value="0"/>
</restriction>
</simpleType>
<simpleType name="skuType">
<annotation>
<documentation>sku</documentation>
</annotation>
<restriction base="string">
<minLength value="11"/>
<maxLength value="20"/>
<pattern value="\d{11,20}"/>
</restriction>
</simpleType>
</schema>
and with the following class:
public class XMLValidator
// Instancia singleton
private static XMLValidator validator = new XMLValidator();
* Constructor privado
private XMLValidator()
* Mitodo para acceder a la instancia Singleton de XMLValidator
* @regresa <b>XMLValidator</b> La instancia de esta clase
public static XMLValidator getValidator()
return validator;
public boolean validaEsquema( String docXML, String esquema ) throws Exception
// Establece el URL correcto para el documento de esquema
XSDBuilder builder = new XSDBuilder();
URL url = createURL( esquema );
// Construye el objecto del Schema XML
try
XMLSchema schemadoc = (XMLSchema)builder.build( url );
// Valida el documento XML procesandolo contra el esquema
return validate( docXML, schemadoc );
catch( XMLParseException e )
throw new Exception( "Error al analizar el documento XML: " + e.getMessage() );
catch( Exception e )
throw new Exception( "No es posible validar con el esquema: " + e.getMessage() );
private static boolean validate(String docXML, XMLSchema schemadoc) throws Exception
boolean isValid = false;
// Crea un objeto Parser DOM de XML
DOMParser dp = new DOMParser();
// Establece el objeto Schema XML para la validacion
dp.setXMLSchema( schemadoc );
dp.setValidationMode( XMLParser.SCHEMA_VALIDATION );
dp.setPreserveWhitespace( true );
// Establece la salida de errores
dp.setErrorStream( System.out );
// Recupera los datos del documento XML en un objeto InputStream
byte[] docbytes = docXML.getBytes();
ByteArrayInputStream in = new ByteArrayInputStream( docbytes );
// Parsea el documento y validalo contra el esquema
try
dp.parse( in );
isValid = true;
catch( Exception e )
// Devuelve el documento XML DOM construido durante el parseo
return isValid;
I am able to validate when invoking with the XML and schemas in the parameters...
Problem is that I have to include the attribute xmlns = "http://palaciohierro.com.mx/mde/expe" in my XML doc.
What I really need is to be able to validate de XML doc against a stablished schema, when the XML doc does not include the
xmlns attribute.

Similar Messages

  • DOM: parsing problem, inputstream

    Hi,
    We are developing a simple server that translates a XML query to a SQL query, sends that SQL query to the database, translates the result to a XML resultset and sends it back to the connecting client.
    We are using DOM to interpret the XML in order to build the XML query, since DOM builds a tree (that we use as a buffer), instead of SAX that has to be interpreted realtime.
    Our problem is as follows: the inputstream of the socket act as the input stream for DOM. No exception occures, but at the point when we call domParser.parse();, the thread hangs. When we close the connection, the local output (at the server) is done; the thread continues.
    We assume that the following causes the problem: the inputstream is used to read the XML from. But when the XML is sent over the stream, the stream is not closed. Somehow the parser still expects something. When the clientconnection is closed, the stream is closed and the thread can continue; the parser know that the input is ended.
    Do you know how to solve this? We cannot just close the connection, because we need to receive the result. Does the parser expects some end indicator? For the inputstream for the parser we use a BufferedReader (otherwise we are getting a NullPointerException).
    Thanks! And cheers,
    Jeroen Oosterlaar

    personaly, for doing a similar stuff, on the server I accumulate the XML lines received over the socket, until I bump into a pre-defined stop line, then I send the accumulated XML data to the parser.
    but it might not be the most elegant solution!

  • Problem in parsing XML using DOM Parser.

    Hi,
    I am parsing an XML using DOM Parser.
    When i try to get attributes of a node, i dont get in the order it is written. For Eg. This the node:
    <Level0 label="News" link="/website/ing_news.nsf/ViewNewsForm?OpenForm&All" level="202" uid="COGN-4MNMT3" parentid="aaaa">
    When i try to print the attribute values i should get in the order:
    News, /website/ing_news.nsf/ViewNewsForm?OpenForm&All, 202, COGN-4MNMT3, aaaa
    BUT I AM GETTING IN THE ORDER:
    News, 202, /website/ing_news.nsf/ViewNewsForm?OpenForm&All, aaaa, COGN-4MNMT3
    Is there any way to sort this problem out?
    Thanks and Regards,
    Ashok

    Hi Guys,
    Thanks a lot for your replies.
    But i want to keep all the values as attributes only.
    the XML file is as shown below:
    <Menu>
    <Level0 label="News" link="/website/ing_news.nsf/ViewNewsForm?OpenForm&All" level="202" uid="COGN-4MNMT3" parentid="aaaa" children="3">
         <Level1 label="ING News" link="" level="1" uid="COGN-4MNN89" parentid="COGN-4MNMT3" children="3" >
              <Level2 label="All ING News" link="/website/ing_news.nsf/ViewNewsForm?OpenForm&All" level="2" uid="INGD-4MVTK2" parentid="COGN-4MNN89" children="0">
              </Level2>
    </Level1>
    </Level0>
    The code i was using to get attributes is:
    String strElementName = new String(node.getNodeName());
         // System.out.println("strElementName:"+node.getNodeName());
    NamedNodeMap attrs = node.getAttributes();
    if (attrs != null) {
    int iLength = attrs.getLength();
    for (int i = 0; i < iLength; i++) {
    String strAttributes = (String) attrs.item(i).getNodeName();
    String strValues = (String) attrs.item(i).getNodeValue();
    Also is it not possible to Enforce the order using some Schema/DTD in this case?
    TIA
    Ashok

  • Dom Parsing and BR tag problem...

    hi all,
    I have a Dom parser which examines an xml file and creates a Jtree from its content... it works fine except that when it meets a </br> tag it creates a new node for it in the tree... is there anyway to get it to consider the two "node" as one...
    example:
    - <p>
    some text 1
    some text 2
    </p>
    should be added in one node as some text 1 some text 2 instead it puts some text 1 in one node and some text 2 in another....
    thanks
    Lila

    oooh sorry i didnt check how the message looked this is the question:
    hi all, I have a Dom parser which examines an xml file and creates a Jtree from its content... it works fine except that when it meets a / BR tag it creates a new node for it in the tree... is there anyway to get it to consider the two "node" as one... example: -
    < p >
    some text 1
    < / BR > <--- THIS NODE IS PROBLEM
    some text 2
    < / p >
    should be added in one node as some text 1 some text 2 instead it puts some text 1 in one node and some text 2 in another....
    thanks
    Lila

  • Problem in parsing a xml string using dom parser

    i want to parse a Xml String using a Dom parser......the parse function in dom parser takes only input stream as argument.......so i made the code as
    InputStream inputstream = new StringBufferInputStream(XmlData) ;
    InputSource inputSource = new InputSource(inputstream );
    but saxexception is coming and also warning called
    "java.io.StringBufferInputStream in java.io has been deprecated"
    please help me.........

    i want to parse a Xml String using a Dom
    parser......the parse function in dom parser takes
    only input stream as argument.......This is not true of the DOM parser in Java 1.4. So you might want to get rid of your old parser and replace it by something more current. Or perhaps you are using 1.4 and you just didn't read all of the API docs.

  • Strange Problem about Dom Parser

    Hi, all
    I am using Dom parser to extract content from one xml file, and it works this afternoon, then tonight when i tried to run again, it gives me an exception:
    org.xml.sax.SAXParseException: Document root element "Total", must match DOCTYPE root "null".
    In my xml file, i don't have <!DOCTYPE ....>, but it is the same xml file i run this afternoon, also, as far as i know, <!DOCTYPE> is not necessary, right?
    Please help me, really frustrated here!

    The parser class only supports a class derived from the java.io.Reader class. I am not sure if there is a class that derives from such that would handle a url string. You may need to obtain the file using java.net for the url and then pass that to a FileReader object.
    One thing that i just thought of that might work is this:
    parser.parse(new File(url));

  • XML parsing problem

    Hi, my problem is :
    In my Application i want to parse an XML file with DOM parser. The problem is that in my Project "MyProject -> Project Properties -> Libraries and Classpath"
    I have included some 15 libraries which are useful for my Application: ADF Faces Runtime 11, ADF Web Runtime and etc.
    Problems are causing the libraries: BC4J Runtime,ADF Model Runtime, MDS Runtime Dependencies
    because when added my source which is parsing an XML file stops working.The source code is:
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    File file =
    new File("C:\\Documents and Settings\\ilia\\Desktop\\begin.xml");
    Document doc = db.parse(file);
    Element root = doc.getDocumentElement();
    NodeList dots = root.getElementsByTagName("w:t");
    Element firstDot = (Element)dots.item(0);
    String textValue = firstDot.getFirstChild().getNodeValue();
    I use DOM because i need to change some values in the XML file, but its not working neither for reading nor for writing.When debugging I see that it gets the root of the xml but " firstDot.getFirstChild().getNodeValue() " returns null and it breaks with NullPointerException. And that's only when the libraries mentioned above are added to the project. Without them it works just fine !
    I don't know, it's like when added the parser validates my xml against some schema and returns null.
    The xml file is very simple MS Word Document saved as .xml .But I don't think that's the problem.
    Thanks in advance !
    iliya

    Hi all,
    I found the solution to my problem.The right way to parse and change an XML file with DOM parser using the Oracle XML Parser v2 should look like this:
    JXDocumentBuilderFactory factory =
    (JXDocumentBuilderFactory)JXDocumentBuilderFactory.newInstance();
    JXDocumentBuilder documentBuilder =
    (JXDocumentBuilder)factory.newDocumentBuilder();
    File file = new File("c:/Documents and Settings/ilia/Desktop/begin.xml");
    InputStream input =
    new FileInputStream(file);
    XMLDocument xmlDocument = (XMLDocument)(documentBuilder.parse(input));
    System.out.println("Encoding: " + xmlDocument.getEncoding());
    System.out.println("Version: " + xmlDocument.getVersion());
    NodeList namespaceNodeList =
    xmlDocument.getElementsByTagNameNS("http://schemas.microsoft.com/office/word/2003/wordml","t");
    XMLElement namespaceElement17 = (XMLElement)namespaceNodeList.item(17);
    namespaceElement17.getFirstChild().setNodeValue("someString");

  • DOM parsing In Applet (URgent)

    Is it possible to implement DOM parsing in Applet?
    I am getting classnotfoundException .
    I am giving the code below. pl read the code.
    Applet.(parserapplet.java)
    =========================
    import java.io.*;
    import java.awt.*;
    import java.net.*;
    import java.util.*;
    import java.applet.*;
    import com.security.*;
    // for DOM parsing ....
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.w3c.dom.Document;
    import org.w3c.dom.DOMException;
    public class parserapplet extends Applet
    public void init()
    public void start()
    try
    if (Class.forName("com.ms.security.PolicyEngine") != null)
    {  // required for IE
         PolicyEngine.assertPermission( PermissionID.SYSTEM );
    catch (Throwable cnfe)
         System.out.println("Policy Engine Exception: " + cnfe);
    try
         String str = "<?xml
    version=\"1.0\"?><html><body></body></html>";
         ByteArrayInputStream bis = new
    ByteArrayInputStream(str.getBytes());
         System.out.println("After creating input stream");
         BufferedInputStream bufIn     = new BufferedInputStream(new
    DataInputStream(bis));
         parseXMLMessage     (bufIn);
    catch(Exception e){}
    // Actual DOM parsing goes here.....
    public void parseXMLMessage(InputStream xmlMessage)
    Document document      = null;
         DocumentBuilder documentBuilder           = null;
         DocumentBuilderFactory documentBuilderFactory     = null;
         try
         documentBuilderFactory = DocumentBuilderFactory.newInstance();
         documentBuilder     = documentBuilderFactory.newDocumentBuilder();
         document     = documentBuilder.parse(xmlMessage);
         System.out.println("Document node: " + document);
         catch(FactoryConfigurationError fce)
         System.out.println("Exception Factory configuration error " + fce);
         catch(ParserConfigurationException pce)
         System.out.println("Exception Parser configuration Exception " pce);
         catch(SAXException saxe)
         System.out.println("Exception SAX error " + saxe);
         catch(Exception e)
         System.out.println("Exception " + e);
    Html code:
    =========
    <html>
    <body>
    <APPLET code="parserapplet.class" archive = "xalan.jar" width=0
    height=0
    MAYSCRIPT>
    <param name=cabbase value=MyApplet.cab>
    </APPLET>
    </body>
    </html>
    I have signed the Applet using signcode utility and i have put the
    parserapplet.class in the MyApplet cab file and signed it. On invoking
    the html file, it request for permission, and after clicking yes, the
    applet loads.Fine.
    No problem upto this stage.
    But after loading of the applet the following exception is thrown in
    Javaconsole.
    Exception:
    =========
    com.ms.security.SecurityExceptionEx[Host]: cannot access file
    C:\WINNT\Java\lib\jaxp.properties
    at com/ms/security/permissions/FileIOPermission.check
    at com/ms/security/PolicyEngine.deepCheck
    at com/ms/security/PolicyEngine.checkPermission
    at com/ms/security/StandardSecurityManager.chk
    at com/ms/security/StandardSecurityManager.checkRead
    at java/io/File.exists
    at javax/xml/parsers/DocumentBuilderFactory.findFactory
    at javax/xml/parsers/DocumentBuilderFactory.newInstance
    at parserapplet.parseXMLMessage
    at parserapplet.init
    at com/ms/applet/AppletPanel.securedCall0
    at com/ms/applet/AppletPanel.securedCall
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    javax.xml.parsers.FactoryConfigurationError:
    java.lang.ClassNotFoundException:
    org/apache/crimson/jaxp/DocumentBuilderFactoryImpl
    at javax/xml/parsers/DocumentBuilderFactory.newInstance
    at parserapplet.parseXMLMessage
    at parserapplet.init
    at com/ms/applet/AppletPanel.securedCall0
    at com/ms/applet/AppletPanel.securedCall
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    I dont know which .jar file to archive (i tried xalan,crimson, jaxp
    but which of no use). I was surprised why the security Exception is
    thrown , when parsing.
    I have not accessed the System files!( but it searches for
    jaxp.properties file!). I think the jar file is not downloaded. How to
    verify that it is downloaded in applet?
    The above code is only for sample.
    If anybody who knows how to correct it please mail me at:
    "[email protected]" with corrected code. I want this very
    urgently.
    Help meeeeeeeeeeeeeeeeeeee!!!!!
    Prasanna.

    Have you found the answer to this problem? I am having a similar problem when running the parser in an ActiveX Bean.
    THanks

  • JmsAdapter DOM Parsing Exception handling

    Hi,
    I'm currently facing a problem with the behaviour of the Jms Adapter.
    Whenever a JMS message is put in the queue and that message is not XML valid, the Jms Adapter (consumer) throw the exception "DOM Parsing Exception in translator Exception".
    That's fine, I understand that the message was not well formed. But what is not fine is that the underlying BPEL is not instanciated : meaning I can't handle the exception properly.
    Is there a way to force the Jms Adapter not to crash on the DOM Parsing for the BPEL to be instanciated (and then being able to handle the exception there) ?
    Or is there a way to handle the error thrown by the Jms Adapter itself ? How ?
    I think I do have a workaround to this if there is no better option (if both above questions cannot be answered) but I would rather not implement it since it will involve some extra steps / complexity.
    > It would be to check the "native format opaque schema" option and then use a java embedded to decode the base64 into a string for eventually parsing it.
    regards,
    mathieu

    Hi Mathieu,
    The messages that error out before being posted to the service infrastructure are referred to as rejected messages. For example, the Oracle File Adapter selects a file having data in CSV format and tries to translate it to XML format (using NXSD). If there is any error in the translation, this message is rejected and are not be posted to the target composite.
    You can create rejection handlers to handle message errors. Message errors include those that occur during translation, correlation ID mismatch and XML parsing after message reception.
    Docs on how to do that are here...
    http://docs.oracle.com/cd/E28280_01/integration.1111/e10231/life_cycle.htm#CIAIICJJ
    Cheers,
    Vlad

  • Context change by DOM parsing Java Mapping in XI

    Hi Team,
    I would like to know that how can I handle Context Change by DOM Parser Java Mapping in XI.?
    Suppose  the source XML structure I have like below:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Header xmlns:ns0="urn:bp:xi:hr:edm:test:100">
       <FileName>
          <filesub>
             <subname>a</subname>
             <subname>b</subname>
             <subname>c</subname>
          </filesub>
       </FileName>
       <FileName>
          <filesub>
             <subname>d</subname>
             <subname>e</subname>
             <subname>f</subname>
          </filesub>
       </FileName>
    </ns0:Header>
    Where the field FileName can occur maximum thrice(0...3) but the subname field is (0....unbounded) but in the target source I would like to have as given below:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <MT_Test4 xmlns="urn:bp:xi:hr:edm:test:100">
    - <Header>
      <FileName>a</FileName>
      <FileName1>d</FileName1>
        </Header>
    - <Header>
      <FileName>b</FileName>
      <FileName1>e</FileName1>
       </Header>
    Header>
      <FileName>c</FileName>
      <FileName1>f</FileName1>
       </Header>
    </MT_Test4>
    That means the first value from every context of the source field is forming my first and second value in my target first context.Thensecond value from every context is forming my 1st and 2nd value of my target 2nd context and finally 3rd value of every context is forming my 1st and 2nd value of my target 3rd context.Is this possible to done through DOM parsing or we have to do it by UDF only?

    Hi Atanu,
        In my last post I gave an alogorithm to solve the mapping problem. Here is the complete program for the mapping.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    public class DOMParser1  implements StreamTransformation{
         public void execute(InputStream in, OutputStream out)
                   throws StreamTransformationException {
              try
                   DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
                   DocumentBuilder builderel=factory.newDocumentBuilder();
                   /input document in form of XML/
                   Document docIn=builderel.parse(in);
                   /document after parsing/
                   Document docOut=builderel.newDocument();
                   TransformerFactory tf=TransformerFactory.newInstance();
                   Transformer transform=tf.newTransformer();
                   Element root,child,child1=null;
                   Node textChild;
                   NodeList l;
                   int i,n1,j,div,k;
                   String s[];
                   root=docOut.createElement("MT_Test4");
                   root.setAttribute("xmlns","urn:bp:xi:hr:edm:test:100");
                   l=docIn.getElementsByTagName("subname");
                   n1=l.getLength();
                   s=new String[n1];
                   for(i=0;i<n1;++i)
                             s<i>=l.item(i).getFirstChild().getNodeValue();
                   l=docIn.getElementsByTagName("filesub");
                   div=l.getLength();
                   j=n1/div;
                   for(i=0,k=0;i<j;++i)
                        child1=docOut.createElement("Header");
                        root.appendChild(child1);
                        child=docOut.createElement("FileName");
                        textChild=docOut.createTextNode(s[k]);
                        child.appendChild(textChild);
                        child1.appendChild(child);
                        child=docOut.createElement("FileName1");
                        textChild=docOut.createTextNode(s [ k + j ]);
                        child.appendChild(textChild);
                        child1.appendChild(child);
                        ++k;
                   docOut.appendChild(root);
                   transform.transform(new DOMSource(docOut), new StreamResult(out));     
              catch(Exception e)
                   e.printStackTrace();
         public void setParameter(Map arg0) {
         public static void main(String[] args) {
              try{
                   DOMParser1 genFormat=new DOMParser1();
                   FileInputStream in=new FileInputStream("C:/Apps/my dw/sdnq/apps.xml");
                   FileOutputStream out=new FileOutputStream("C:/Apps/my dw/sdnq/tgt1.xml");
                   genFormat.execute(in,out);
              catch(Exception e)
                   e.printStackTrace();
    source ->  apps.xml
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:Header xmlns:ns0="urn:bp:xi:hr:edm:test:100">
    - <FileName>
    - <filesub>
      <subname>a</subname>
      <subname>b</subname>
      <subname>c</subname>
      </filesub>
      </FileName>
    - <FileName>
    - <filesub>
      <subname>d</subname>
      <subname>e</subname>
      <subname>f</subname>
      </filesub>
      </FileName>
      </ns0:Header>
    target structure ->  tgt1.xml
    <?xml version="1.0" encoding="UTF-8" ?>
    - <MT_Test4 xmlns="urn:bp:xi:hr:edm:test:100">
    - <Header>
      <FileName>a</FileName>
      <FileName1>d</FileName1>
      </Header>
    - <Header>
      <FileName>b</FileName>
      <FileName1>e</FileName1>
      </Header>
    - <Header>
      <FileName>c</FileName>
      <FileName1>f</FileName1>
      </Header>
      </MT_Test4>
    Hope this helps
    one more thing  in this line "textChild=docOut.createTextNode(s k + j );"   somehow the the third braces one opening  before k and one closing after j is missing for unknown reasons. Please correct it when you actually run this code.
    regards
    Anupam
    Edited by: anupamsap on Mar 7, 2011 12:47 PM

  • Integration between B2B and ESB error (DOM Parsing Exception in translator)

    Hello,
    We have configured a circuit that has the objective of sending a message to B2B and then the ESB dequeues that message from the IP_IN_QUEUE.
    The problem is that for some reason, the ESB cannot read message using the AQ Adapter object.
    The error is the following:
    DOM Parsing Exception in translator. DOM parsing exception in inbound XSD translator while parsing InputStream. Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable.
    The trace is the following:
    ORABPEL-11211 DOM Parsing Exception in translator. DOM parsing exception in inbound XSD translator while parsing InputStream. Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable. at oracle.tip.pc.services.translation.xlators.xsd.XSDTranslator.translateFromNative(XSDTranslator.java:139) at oracle.tip.adapter.aq.database.MessageReader.translateFromNative(MessageReader.java:1179) at oracle.tip.adapter.aq.database.MessageReader.readMessage(MessageReader.java:533) at oracle.tip.adapter.aq.inbound.AQActivationSpecDequeuer.run(AQActivationSpecDequeuer.java:189) at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242) at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215) at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:819) at java.lang.Thread.run(Thread.java:595) Caused by: oracle.xml.parser.v2.XMLParseException: '=' missing in attribute. at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320) at oracle.xml.parser.v2.NonValidatingParser.parseAttrValue(NonValidatingParser.java:1609) at oracle.xml.parser.v2.NonValidatingParser.parseAttr(NonValidatingParser.java:1514) at oracle.xml.parser.v2.NonValidatingParser.parseAttributes(NonValidatingParser.java:1447) at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1286) at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336) at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303) at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:291) at oracle.tip.pc.services.translation.xlators.xsd.XSDTranslator.translateFromNative(XSDTranslator.java:134) ... 8 more
    The Payload is the following:
    <?xml version="1.0" ?><OMG_O19 xmlns="urn:oracle:integration:b2b:C023D5B231EF45519AA3D9929B4990E1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" XDataVersion="2.0" Standard="HL7" Version="2.4" CreatedDate="2007-07-17T17:10:43" CreatedBy="ECXEngine_837" GUID="{D16D28B9-3821-4BCC-B4D9-0D92F8611BB5}"><Internal-Properties><Data-Structure Name="Message"><Lookup Name="MessageSendingApp">ALERT</Lookup><Lookup Name="MessageSendingAppUniversalID"></Lookup><Lookup Name="MessageSendingAppUniversalIDType"></Lookup><Lookup Name="MessageSendingFacility">CHVNG</Lookup><Lookup Name="MessageSendingFacilityUniversalID"></Lookup><Lookup Name="MessageSendingFacilityUniversalIDType"></Lookup><Lookup Name="MessageReceivingApp">RADIO</Lookup><Lookup Name="MessageReceivingAppUniversalID"></Lookup><Lookup Name="MessageReceivingAppUniversalIDType"></Lookup><Lookup Name="MessageReceivingFacility">CHVNG</Lookup><Lookup Name="MessageReceivingFacilityUniversalID"></Lookup><Lookup Name="MessageReceivingFacilityUniversalIDType"></Lookup><Lookup Name="MessageCode">OMG</Lookup><Lookup Name="TriggerEvent">O19</Lookup><Lookup Name="MessageStructure">OMG_O19</Lookup><Lookup Name="MessageVersion">2.4</Lookup><Lookup Name="InternatCodeID"></Lookup><Lookup Name="InternatCodeText"></Lookup><Lookup Name="InternatCodeSystem"></Lookup><Lookup Name="InternatCodeAlternateID"></Lookup><Lookup Name="InternatCodeAlternateText"></Lookup><Lookup Name="InternatCodeAlternateSystem"></Lookup><Lookup Name="InternationalVersionID"></Lookup><Lookup Name="InternationalVersionIDText"></Lookup><Lookup Name="InternationalVersionIDSystem"></Lookup><Lookup Name="InternationalVersionIDAlternateID"></Lookup><Lookup Name="InternationalVersionIDAlternateText"></Lookup><Lookup Name="InternationalVersionIDAlternateSystem"></Lookup><Lookup Name="Standard">HL7</Lookup><Property Name="MessageEncodingCharacters">^~\&amp;</Property><Property Name="MessageSendingApp">ALERT</Property><Property Name="MessageSendingAppUniversalID"></Property><Property Name="MessageSendingAppUniversalIDType"></Property><Property Name="MessageSendingFacility">CHVNG</Property><Property Name="MessageSendingFacilityUniversalID"></Property><Property Name="MessageSendingFacilityUniversalIDType"></Property><Property Name="MessageReceivingApp">RADIO</Property><Property Name="MessageReceivingAppUniversalID"></Property><Property Name="MessageReceivingAppUniversalIDType"></Property><Property Name="MessageReceivingFacility">CHVNG</Property><Property Name="MessageReceivingFacilityUniversalID"></Property><Property Name="MessageReceivingFacilityUniversalIDType"></Property><Property Name="MessageDate">20070705161247+0000</Property><Property Name="MessageDateTimePrecision"></Property><Property Name="MessageSecurity"></Property><Property Name="MessageCode">OMG</Property><Property Name="TriggerEvent">O19</Property><Property Name="MessageStructure">OMG_O19</Property><Property Name="MessageControlID">1709</Property><Property Name="ProcessingID">P</Property><Property Name="ProcessingMode"></Property><Property Name="MessageVersion">2.4</Property><Property Name="InternatCodeID"></Property><Property Name="InternatCodeText"></Property><Property Name="InternatCodeSystem"></Property><Property Name="InternatCodeAlternateID"></Property><Property Name="InternatCodeAlternateText"></Property><Property Name="InternatCodeAlternateSystem"></Property><Property Name="InternationalVersionID"></Property><Property Name="InternationalVersionIDText"></Property><Property Name="InternationalVersionIDSystem"></Property><Property Name="InternationalVersionIDAlternateID"></Property><Property Name="InternationalVersionIDAlternateText"></Property><Property Name="InternationalVersionIDAlternateSystem"></Property><Property Name="SequenceNumber"></Property><Property Name="ContinuationPointer"></Property><Property Name="AcceptAckType"></Property><Property Name="AppAckType"></Property><Property Name="CountryCode"></Property><Property Name="CharacterSet"></Property><Property Name="LanguageID"></Property><Property Name="LanguageText"></Property><Property Name="LanguageSystem"></Property><Property Name="LanguageAlternateID"></Property><Property Name="LanguageAlternateText"></Property><Property Name="LanguageAlternateSystem"></Property><Property Name="AlternateCharacterSetSchema"></Property><Property Name="ConformanceStatementID"></Property><Property Name="MessageProfileNamespaceID"></Property><Property Name="MessageProfileUniversalID"></Property><Property Name="MessageProfileUniversalIDType"></Property><Property Name="DecimalSeparator"></Property><Property Name="ElementDelimiter">0x7c</Property><Property Name="ReleaseCharacter">0x5c</Property><Property Name="RepeatingSeparator">0x7e</Property><Property Name="SegmentDelimiter">0xd</Property><Property Name="SubcomponentDelimiter">0x26</Property><Property Name="SubelementDelimiter">0x5e</Property></Data-Structure></Internal-Properties><MSH><MSH.1>|</MSH.1><MSH.2>^~\&amp;</MSH.2><MSH.3><HD.1>ALERT</HD.1></MSH.3><MSH.4><HD.1>CHVNG</HD.1></MSH.4><MSH.5><HD.1>RADIO</HD.1></MSH.5><MSH.6><HD.1>CHVNG</HD.1></MSH.6><MSH.7><TS.1>20070705161247+0000</TS.1></MSH.7><MSH.8 xsi:nil="true"></MSH.8><MSH.9><MSG.1>OMG</MSG.1><MSG.2>O19</MSG.2><MSG.3>OMG_O19</MSG.3></MSH.9><MSH.10>1709</MSH.10><MSH.11><PT.1>P</PT.1></MSH.11><MSH.12><VID.1>2.4</VID.1></MSH.12><MSH.13 xsi:nil="true"></MSH.13></MSH><Extra-
    PID><Extra-
    PID.1 xsi:nil="true"></Extra-
    PID.1><Extra-
    PID.2 xsi:nil="true"></Extra-
    PID.2><Extra-
    PID.3><Extra-
    PID.3.1>390971</Extra-
    PID.3.1><Extra-
    PID.3.2 xsi:nil="true"></Extra-
    PID.3.2><Extra-
    PID.3.3 xsi:nil="true"></Extra-
    PID.3.3><Extra-
    PID.3.4>CHVNG</Extra-
    PID.3.4><Extra-
    PID.3.5>NS</Extra-
    PID.3.5></Extra-
    PID.3><Extra-
    PID.4 xsi:nil="true"></Extra-
    PID.4><Extra-
    PID.5><Extra-
    PID.5.1>Santos</Extra-
    PID.5.1><Extra-
    PID.5.2>Paula</Extra-
    PID.5.2><Extra-
    PID.5.3>Cristina Silva Lopes</Extra-
    PID.5.3></Extra-
    PID.5><Extra-
    PID.6 xsi:nil="true"></Extra-
    PID.6><Extra-
    PID.7>19720117000000+0000</Extra-
    PID.7><Extra-
    PID.8 xsi:nil="true"></Extra-
    PID.8><Extra-
    PID.9 xsi:nil="true"></Extra-
    PID.9><Extra-
    PID.10 xsi:nil="true"></Extra-
    PID.10><Extra-
    PID.11><Extra-
    PID.11.1>R Bernardino Costa 358 Bl D Hab 04</Extra-
    PID.11.1><Extra-
    PID.11.2 xsi:nil="true"></Extra-
    PID.11.2><Extra-
    PID.11.3>Valadares</Extra-
    PID.11.3><Extra-
    PID.11.4 xsi:nil="true"></Extra-
    PID.11.4><Extra-
    PID.11.5>4405</Extra-
    PID.11.5></Extra-
    PID.11><Extra-
    PID.12 xsi:nil="true"></Extra-
    PID.12><Extra-
    PID.13 xsi:nil="true"></Extra-
    PID.13><Extra-
    PID.14 xsi:nil="true"></Extra-
    PID.14><Extra-
    PID.15 xsi:nil="true"></Extra-
    PID.15><Extra-
    PID.16 xsi:nil="true"></Extra-
    PID.16><Extra-
    PID.17 xsi:nil="true"></Extra-
    PID.17><Extra-
    PID.18>7011588</Extra-
    PID.18><Extra-
    PID.19 xsi:nil="true"></Extra-
    PID.19></Extra-
    PID><Extra-
    PV1><Extra-
    PV1.1 xsi:nil="true"></Extra-
    PV1.1><Extra-
    PV1.2>URG</Extra-
    PV1.2><Extra-
    PV1.3><Extra-
    PV1.3.1>1</Extra-
    PV1.3.1><Extra-
    PV1.3.2 xsi:nil="true"></Extra-
    PV1.3.2><Extra-
    PV1.3.3 xsi:nil="true"></Extra-
    PV1.3.3><Extra-
    PV1.3.4>CHVNG</Extra-
    PV1.3.4></Extra-
    PV1.3><Extra-
    PV1.4 xsi:nil="true"></Extra-
    PV1.4><Extra-
    PV1.5 xsi:nil="true"></Extra-
    PV1.5><Extra-
    PV1.6 xsi:nil="true"></Extra-
    PV1.6><Extra-
    PV1.7 xsi:nil="true"></Extra-
    PV1.7><Extra-
    PV1.8 xsi:nil="true"></Extra-
    PV1.8><Extra-
    PV1.9 xsi:nil="true"></Extra-
    PV1.9><Extra-
    PV1.10 xsi:nil="true"></Extra-
    PV1.10><Extra-
    PV1.11 xsi:nil="true"></Extra-
    PV1.11><Extra-
    PV1.12 xsi:nil="true"></Extra-
    PV1.12><Extra-
    PV1.13 xsi:nil="true"></Extra-
    PV1.13><Extra-
    PV1.14 xsi:nil="true"></Extra-
    PV1.14><Extra-
    PV1.15 xsi:nil="true"></Extra-
    PV1.15><Extra-
    PV1.16 xsi:nil="true"></Extra-
    PV1.16><Extra-
    PV1.17 xsi:nil="true"></Extra-
    PV1.17><Extra-
    PV1.18>URG</Extra-
    PV1.18><Extra-
    PV1.19><Extra-
    PV1.19.1>7088430</Extra-
    PV1.19.1><Extra-
    PV1.19.2 xsi:nil="true"></Extra-
    PV1.19.2><Extra-
    PV1.19.3 xsi:nil="true"></Extra-
    PV1.19.3><Extra-
    PV1.19.4>SONHO</Extra-
    PV1.19.4></Extra-
    PV1.19><Extra-
    PV1.20 xsi:nil="true"></Extra-
    PV1.20><Extra-
    PV1.21 xsi:nil="true"></Extra-
    PV1.21><Extra-
    PV1.22 xsi:nil="true"></Extra-
    PV1.22><Extra-
    PV1.23 xsi:nil="true"></Extra-
    PV1.23><Extra-
    PV1.24 xsi:nil="true"></Extra-
    PV1.24><Extra-
    PV1.25 xsi:nil="true"></Extra-
    PV1.25><Extra-
    PV1.26 xsi:nil="true"></Extra-
    PV1.26><Extra-
    PV1.27 xsi:nil="true"></Extra-
    PV1.27><Extra-
    PV1.28 xsi:nil="true"></Extra-
    PV1.28><Extra-
    PV1.29 xsi:nil="true"></Extra-
    PV1.29><Extra-
    PV1.30 xsi:nil="true"></Extra-
    PV1.30><Extra-
    PV1.31 xsi:nil="true"></Extra-
    PV1.31><Extra-
    PV1.32 xsi:nil="true"></Extra-
    PV1.32><Extra-
    PV1.33 xsi:nil="true"></Extra-
    PV1.33><Extra-
    PV1.34 xsi:nil="true"></Extra-
    PV1.34><Extra-
    PV1.35 xsi:nil="true"></Extra-
    PV1.35><Extra-
    PV1.36 xsi:nil="true"></Extra-
    PV1.36><Extra-
    PV1.37 xsi:nil="true"></Extra-
    PV1.37><Extra-
    PV1.38 xsi:nil="true"></Extra-
    PV1.38><Extra-
    PV1.39 xsi:nil="true"></Extra-
    PV1.39><Extra-
    PV1.40 xsi:nil="true"></Extra-
    PV1.40><Extra-
    PV1.41 xsi:nil="true"></Extra-
    PV1.41><Extra-
    PV1.42 xsi:nil="true"></Extra-
    PV1.42><Extra-
    PV1.43 xsi:nil="true"></Extra-
    PV1.43><Extra-
    PV1.44>20070705154838+0000</Extra-
    PV1.44><Extra-
    PV1.45 xsi:nil="true"></Extra-
    PV1.45><Extra-
    PV1.46 xsi:nil="true"></Extra-
    PV1.46><Extra-
    PV1.47 xsi:nil="true"></Extra-
    PV1.47><Extra-
    PV1.48 xsi:nil="true"></Extra-
    PV1.48><Extra-
    PV1.49 xsi:nil="true"></Extra-
    PV1.49><Extra-
    PV1.50 xsi:nil="true"></Extra-
    PV1.50><Extra-
    PV1.51>V</Extra-
    PV1.51><Extra-
    PV1.52 xsi:nil="true"></Extra-
    PV1.52></Extra-
    PV1><Extra-
    ORC><Extra-
    ORC.1>NW</Extra-
    ORC.1><Extra-
    ORC.2><Extra-
    ORC.2.1>19013</Extra-
    ORC.2.1><Extra-
    ORC.2.2>ALERT</Extra-
    ORC.2.2></Extra-
    ORC.2><Extra-
    ORC.3 xsi:nil="true"></Extra-
    ORC.3><Extra-
    ORC.4 xsi:nil="true"></Extra-
    ORC.4><Extra-
    ORC.5>NW</Extra-
    ORC.5><Extra-
    ORC.6 xsi:nil="true"></Extra-
    ORC.6><Extra-
    ORC.7 xsi:nil="true"></Extra-
    ORC.7><Extra-
    ORC.8 xsi:nil="true"></Extra-
    ORC.8><Extra-
    ORC.9 xsi:nil="true"></Extra-
    ORC.9><Extra-
    ORC.10 xsi:nil="true"></Extra-
    ORC.10><Extra-
    ORC.11 xsi:nil="true"></Extra-
    ORC.11><Extra-
    ORC.12><Extra-
    ORC.12.1>4292</Extra-
    ORC.12.1><Extra-
    ORC.12.2>Martinez</Extra-
    ORC.12.2><Extra-
    ORC.12.3>Cristina</Extra-
    ORC.12.3></Extra-
    ORC.12><Extra-
    ORC.13 xsi:nil="true"></Extra-
    ORC.13></Extra-
    ORC><Extra-
    OBR><Extra-
    OBR.1>1</Extra-
    OBR.1><Extra-
    OBR.2><Extra-
    OBR.2.1>19013</Extra-
    OBR.2.1><Extra-
    OBR.2.2>ALERT</Extra-
    OBR.2.2></Extra-
    OBR.2><Extra-
    OBR.3 xsi:nil="true"></Extra-
    OBR.3><Extra-
    OBR.4><Extra-
    OBR.4.1>10781</Extra-
    OBR.4.1><Extra-
    OBR.4.2>M<escape V="XE3"/>o direita, duas incid<escape V="XEA"/>ncias</Extra-
    OBR.4.2><Extra-
    OBR.4.3>CHVNG</Extra-
    OBR.4.3></Extra-
    OBR.4><Extra-
    OBR.5 xsi:nil="true"></Extra-
    OBR.5><Extra-
    OBR.6 xsi:nil="true"></Extra-
    OBR.6><Extra-
    OBR.7 xsi:nil="true"></Extra-
    OBR.7><Extra-
    OBR.8 xsi:nil="true"></Extra-
    OBR.8><Extra-
    OBR.9 xsi:nil="true"></Extra-
    OBR.9><Extra-
    OBR.10 xsi:nil="true"></Extra-
    OBR.10><Extra-
    OBR.11 xsi:nil="true"></Extra-
    OBR.11><Extra-
    OBR.12 xsi:nil="true"></Extra-
    OBR.12><Extra-
    OBR.13 xsi:nil="true"></Extra-
    OBR.13><Extra-
    OBR.14 xsi:nil="true"></Extra-
    OBR.14><Extra-
    OBR.15 xsi:nil="true"></Extra-
    OBR.15><Extra-
    OBR.16><Extra-
    OBR.16.1>4292</Extra-
    OBR.16.1><Extra-
    OBR.16.2>Martinez</Extra-
    OBR.16.2><Extra-
    OBR.16.3>Cristina</Extra-
    OBR.16.3></Extra-
    OBR.16><Extra-
    OBR.17 xsi:nil="true"></Extra-
    OBR.17><Extra-
    OBR.18 xsi:nil="true"></Extra-
    OBR.18><Extra-
    OBR.19 xsi:nil="true"></Extra-
    OBR.19><Extra-
    OBR.20 xsi:nil="true"></Extra-
    OBR.20><Extra-
    OBR.21 xsi:nil="true"></Extra-
    OBR.21><Extra-
    OBR.22 xsi:nil="true"></Extra-
    OBR.22><Extra-
    OBR.23 xsi:nil="true"></Extra-
    OBR.23><Extra-
    OBR.24 xsi:nil="true"></Extra-
    OBR.24><Extra-
    OBR.25 xsi:nil="true"></Extra-
    OBR.25><Extra-
    OBR.26 xsi:nil="true"></Extra-
    OBR.26><Extra-
    OBR.27><Extra-
    OBR.27.1 xsi:nil="true"></Extra-
    OBR.27.1><Extra-
    OBR.27.2 xsi:nil="true"></Extra-
    OBR.27.2><Extra-
    OBR.27.3 xsi:nil="true"></Extra-
    OBR.27.3><Extra-
    OBR.27.4>20070705161237+0000</Extra-
    OBR.27.4></Extra-
    OBR.27><Extra-
    OBR.28 xsi:nil="true"></Extra-
    OBR.28></Extra-
    OBR><Extra-
    NTE><Extra-
    NTE.1>1</Extra-
    NTE.1><Extra-
    NTE.2 xsi:nil="true"></Extra-
    NTE.2></Extra-
    NTE><Extra-
    DG1><Extra-
    DG1.1>1</Extra-
    DG1.1><Extra-
    DG1.2 xsi:nil="true"></Extra-
    DG1.2><Extra-
    DG1.3><Extra-
    DG1.3.1>9233</Extra-
    DG1.3.1><Extra-
    DG1.3.2>Contusao De Dedo Da Mao</Extra-
    DG1.3.2><Extra-
    DG1.3.3>ICD9</Extra-
    DG1.3.3></Extra-
    DG1.3><Extra-
    DG1.4 xsi:nil="true"></Extra-
    DG1.4><Extra-
    DG1.5 xsi:nil="true"></Extra-
    DG1.5><Extra-
    DG1.6>D</Extra-
    DG1.6></Extra-
    DG1></OMG_O19>
    I think that the problem should be because of the "Extra" (eg. <Extra-
    PID.1 xsi:nil="true">) word that B2B puts in every tag.
    The strange thing is that, this already worked until two days ago....
    What could it be?
    Thanks for your help.
    Best Regards,
    Nuno Fernandes

    Hello,
    We have configured a circuit that has the objective of sending a message to B2B and then the ESB dequeues that message from the IP_IN_QUEUE.
    The problem is that for some reason, the ESB cannot read message using the AQ Adapter object.
    The error is the following:
    DOM Parsing Exception in translator. DOM parsing exception in inbound XSD translator while parsing InputStream. Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable.
    The trace is the following:
    ORABPEL-11211 DOM Parsing Exception in translator. DOM parsing exception in inbound XSD translator while parsing InputStream. Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable. at oracle.tip.pc.services.translation.xlators.xsd.XSDTranslator.translateFromNative(XSDTranslator.java:139) at oracle.tip.adapter.aq.database.MessageReader.translateFromNative(MessageReader.java:1179) at oracle.tip.adapter.aq.database.MessageReader.readMessage(MessageReader.java:533) at oracle.tip.adapter.aq.inbound.AQActivationSpecDequeuer.run(AQActivationSpecDequeuer.java:189) at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242) at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215) at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:819) at java.lang.Thread.run(Thread.java:595) Caused by: oracle.xml.parser.v2.XMLParseException: '=' missing in attribute. at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320) at oracle.xml.parser.v2.NonValidatingParser.parseAttrValue(NonValidatingParser.java:1609) at oracle.xml.parser.v2.NonValidatingParser.parseAttr(NonValidatingParser.java:1514) at oracle.xml.parser.v2.NonValidatingParser.parseAttributes(NonValidatingParser.java:1447) at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1286) at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336) at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303) at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:291) at oracle.tip.pc.services.translation.xlators.xsd.XSDTranslator.translateFromNative(XSDTranslator.java:134) ... 8 more
    The Payload is the following:
    <?xml version="1.0" ?><OMG_O19 xmlns="urn:oracle:integration:b2b:C023D5B231EF45519AA3D9929B4990E1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" XDataVersion="2.0" Standard="HL7" Version="2.4" CreatedDate="2007-07-17T17:10:43" CreatedBy="ECXEngine_837" GUID="{D16D28B9-3821-4BCC-B4D9-0D92F8611BB5}"><Internal-Properties><Data-Structure Name="Message"><Lookup Name="MessageSendingApp">ALERT</Lookup><Lookup Name="MessageSendingAppUniversalID"></Lookup><Lookup Name="MessageSendingAppUniversalIDType"></Lookup><Lookup Name="MessageSendingFacility">CHVNG</Lookup><Lookup Name="MessageSendingFacilityUniversalID"></Lookup><Lookup Name="MessageSendingFacilityUniversalIDType"></Lookup><Lookup Name="MessageReceivingApp">RADIO</Lookup><Lookup Name="MessageReceivingAppUniversalID"></Lookup><Lookup Name="MessageReceivingAppUniversalIDType"></Lookup><Lookup Name="MessageReceivingFacility">CHVNG</Lookup><Lookup Name="MessageReceivingFacilityUniversalID"></Lookup><Lookup Name="MessageReceivingFacilityUniversalIDType"></Lookup><Lookup Name="MessageCode">OMG</Lookup><Lookup Name="TriggerEvent">O19</Lookup><Lookup Name="MessageStructure">OMG_O19</Lookup><Lookup Name="MessageVersion">2.4</Lookup><Lookup Name="InternatCodeID"></Lookup><Lookup Name="InternatCodeText"></Lookup><Lookup Name="InternatCodeSystem"></Lookup><Lookup Name="InternatCodeAlternateID"></Lookup><Lookup Name="InternatCodeAlternateText"></Lookup><Lookup Name="InternatCodeAlternateSystem"></Lookup><Lookup Name="InternationalVersionID"></Lookup><Lookup Name="InternationalVersionIDText"></Lookup><Lookup Name="InternationalVersionIDSystem"></Lookup><Lookup Name="InternationalVersionIDAlternateID"></Lookup><Lookup Name="InternationalVersionIDAlternateText"></Lookup><Lookup Name="InternationalVersionIDAlternateSystem"></Lookup><Lookup Name="Standard">HL7</Lookup><Property Name="MessageEncodingCharacters">^~\&amp;</Property><Property Name="MessageSendingApp">ALERT</Property><Property Name="MessageSendingAppUniversalID"></Property><Property Name="MessageSendingAppUniversalIDType"></Property><Property Name="MessageSendingFacility">CHVNG</Property><Property Name="MessageSendingFacilityUniversalID"></Property><Property Name="MessageSendingFacilityUniversalIDType"></Property><Property Name="MessageReceivingApp">RADIO</Property><Property Name="MessageReceivingAppUniversalID"></Property><Property Name="MessageReceivingAppUniversalIDType"></Property><Property Name="MessageReceivingFacility">CHVNG</Property><Property Name="MessageReceivingFacilityUniversalID"></Property><Property Name="MessageReceivingFacilityUniversalIDType"></Property><Property Name="MessageDate">20070705161247+0000</Property><Property Name="MessageDateTimePrecision"></Property><Property Name="MessageSecurity"></Property><Property Name="MessageCode">OMG</Property><Property Name="TriggerEvent">O19</Property><Property Name="MessageStructure">OMG_O19</Property><Property Name="MessageControlID">1709</Property><Property Name="ProcessingID">P</Property><Property Name="ProcessingMode"></Property><Property Name="MessageVersion">2.4</Property><Property Name="InternatCodeID"></Property><Property Name="InternatCodeText"></Property><Property Name="InternatCodeSystem"></Property><Property Name="InternatCodeAlternateID"></Property><Property Name="InternatCodeAlternateText"></Property><Property Name="InternatCodeAlternateSystem"></Property><Property Name="InternationalVersionID"></Property><Property Name="InternationalVersionIDText"></Property><Property Name="InternationalVersionIDSystem"></Property><Property Name="InternationalVersionIDAlternateID"></Property><Property Name="InternationalVersionIDAlternateText"></Property><Property Name="InternationalVersionIDAlternateSystem"></Property><Property Name="SequenceNumber"></Property><Property Name="ContinuationPointer"></Property><Property Name="AcceptAckType"></Property><Property Name="AppAckType"></Property><Property Name="CountryCode"></Property><Property Name="CharacterSet"></Property><Property Name="LanguageID"></Property><Property Name="LanguageText"></Property><Property Name="LanguageSystem"></Property><Property Name="LanguageAlternateID"></Property><Property Name="LanguageAlternateText"></Property><Property Name="LanguageAlternateSystem"></Property><Property Name="AlternateCharacterSetSchema"></Property><Property Name="ConformanceStatementID"></Property><Property Name="MessageProfileNamespaceID"></Property><Property Name="MessageProfileUniversalID"></Property><Property Name="MessageProfileUniversalIDType"></Property><Property Name="DecimalSeparator"></Property><Property Name="ElementDelimiter">0x7c</Property><Property Name="ReleaseCharacter">0x5c</Property><Property Name="RepeatingSeparator">0x7e</Property><Property Name="SegmentDelimiter">0xd</Property><Property Name="SubcomponentDelimiter">0x26</Property><Property Name="SubelementDelimiter">0x5e</Property></Data-Structure></Internal-Properties><MSH><MSH.1>|</MSH.1><MSH.2>^~\&amp;</MSH.2><MSH.3><HD.1>ALERT</HD.1></MSH.3><MSH.4><HD.1>CHVNG</HD.1></MSH.4><MSH.5><HD.1>RADIO</HD.1></MSH.5><MSH.6><HD.1>CHVNG</HD.1></MSH.6><MSH.7><TS.1>20070705161247+0000</TS.1></MSH.7><MSH.8 xsi:nil="true"></MSH.8><MSH.9><MSG.1>OMG</MSG.1><MSG.2>O19</MSG.2><MSG.3>OMG_O19</MSG.3></MSH.9><MSH.10>1709</MSH.10><MSH.11><PT.1>P</PT.1></MSH.11><MSH.12><VID.1>2.4</VID.1></MSH.12><MSH.13 xsi:nil="true"></MSH.13></MSH><Extra-
    PID><Extra-
    PID.1 xsi:nil="true"></Extra-
    PID.1><Extra-
    PID.2 xsi:nil="true"></Extra-
    PID.2><Extra-
    PID.3><Extra-
    PID.3.1>390971</Extra-
    PID.3.1><Extra-
    PID.3.2 xsi:nil="true"></Extra-
    PID.3.2><Extra-
    PID.3.3 xsi:nil="true"></Extra-
    PID.3.3><Extra-
    PID.3.4>CHVNG</Extra-
    PID.3.4><Extra-
    PID.3.5>NS</Extra-
    PID.3.5></Extra-
    PID.3><Extra-
    PID.4 xsi:nil="true"></Extra-
    PID.4><Extra-
    PID.5><Extra-
    PID.5.1>Santos</Extra-
    PID.5.1><Extra-
    PID.5.2>Paula</Extra-
    PID.5.2><Extra-
    PID.5.3>Cristina Silva Lopes</Extra-
    PID.5.3></Extra-
    PID.5><Extra-
    PID.6 xsi:nil="true"></Extra-
    PID.6><Extra-
    PID.7>19720117000000+0000</Extra-
    PID.7><Extra-
    PID.8 xsi:nil="true"></Extra-
    PID.8><Extra-
    PID.9 xsi:nil="true"></Extra-
    PID.9><Extra-
    PID.10 xsi:nil="true"></Extra-
    PID.10><Extra-
    PID.11><Extra-
    PID.11.1>R Bernardino Costa 358 Bl D Hab 04</Extra-
    PID.11.1><Extra-
    PID.11.2 xsi:nil="true"></Extra-
    PID.11.2><Extra-
    PID.11.3>Valadares</Extra-
    PID.11.3><Extra-
    PID.11.4 xsi:nil="true"></Extra-
    PID.11.4><Extra-
    PID.11.5>4405</Extra-
    PID.11.5></Extra-
    PID.11><Extra-
    PID.12 xsi:nil="true"></Extra-
    PID.12><Extra-
    PID.13 xsi:nil="true"></Extra-
    PID.13><Extra-
    PID.14 xsi:nil="true"></Extra-
    PID.14><Extra-
    PID.15 xsi:nil="true"></Extra-
    PID.15><Extra-
    PID.16 xsi:nil="true"></Extra-
    PID.16><Extra-
    PID.17 xsi:nil="true"></Extra-
    PID.17><Extra-
    PID.18>7011588</Extra-
    PID.18><Extra-
    PID.19 xsi:nil="true"></Extra-
    PID.19></Extra-
    PID><Extra-
    PV1><Extra-
    PV1.1 xsi:nil="true"></Extra-
    PV1.1><Extra-
    PV1.2>URG</Extra-
    PV1.2><Extra-
    PV1.3><Extra-
    PV1.3.1>1</Extra-
    PV1.3.1><Extra-
    PV1.3.2 xsi:nil="true"></Extra-
    PV1.3.2><Extra-
    PV1.3.3 xsi:nil="true"></Extra-
    PV1.3.3><Extra-
    PV1.3.4>CHVNG</Extra-
    PV1.3.4></Extra-
    PV1.3><Extra-
    PV1.4 xsi:nil="true"></Extra-
    PV1.4><Extra-
    PV1.5 xsi:nil="true"></Extra-
    PV1.5><Extra-
    PV1.6 xsi:nil="true"></Extra-
    PV1.6><Extra-
    PV1.7 xsi:nil="true"></Extra-
    PV1.7><Extra-
    PV1.8 xsi:nil="true"></Extra-
    PV1.8><Extra-
    PV1.9 xsi:nil="true"></Extra-
    PV1.9><Extra-
    PV1.10 xsi:nil="true"></Extra-
    PV1.10><Extra-
    PV1.11 xsi:nil="true"></Extra-
    PV1.11><Extra-
    PV1.12 xsi:nil="true"></Extra-
    PV1.12><Extra-
    PV1.13 xsi:nil="true"></Extra-
    PV1.13><Extra-
    PV1.14 xsi:nil="true"></Extra-
    PV1.14><Extra-
    PV1.15 xsi:nil="true"></Extra-
    PV1.15><Extra-
    PV1.16 xsi:nil="true"></Extra-
    PV1.16><Extra-
    PV1.17 xsi:nil="true"></Extra-
    PV1.17><Extra-
    PV1.18>URG</Extra-
    PV1.18><Extra-
    PV1.19><Extra-
    PV1.19.1>7088430</Extra-
    PV1.19.1><Extra-
    PV1.19.2 xsi:nil="true"></Extra-
    PV1.19.2><Extra-
    PV1.19.3 xsi:nil="true"></Extra-
    PV1.19.3><Extra-
    PV1.19.4>SONHO</Extra-
    PV1.19.4></Extra-
    PV1.19><Extra-
    PV1.20 xsi:nil="true"></Extra-
    PV1.20><Extra-
    PV1.21 xsi:nil="true"></Extra-
    PV1.21><Extra-
    PV1.22 xsi:nil="true"></Extra-
    PV1.22><Extra-
    PV1.23 xsi:nil="true"></Extra-
    PV1.23><Extra-
    PV1.24 xsi:nil="true"></Extra-
    PV1.24><Extra-
    PV1.25 xsi:nil="true"></Extra-
    PV1.25><Extra-
    PV1.26 xsi:nil="true"></Extra-
    PV1.26><Extra-
    PV1.27 xsi:nil="true"></Extra-
    PV1.27><Extra-
    PV1.28 xsi:nil="true"></Extra-
    PV1.28><Extra-
    PV1.29 xsi:nil="true"></Extra-
    PV1.29><Extra-
    PV1.30 xsi:nil="true"></Extra-
    PV1.30><Extra-
    PV1.31 xsi:nil="true"></Extra-
    PV1.31><Extra-
    PV1.32 xsi:nil="true"></Extra-
    PV1.32><Extra-
    PV1.33 xsi:nil="true"></Extra-
    PV1.33><Extra-
    PV1.34 xsi:nil="true"></Extra-
    PV1.34><Extra-
    PV1.35 xsi:nil="true"></Extra-
    PV1.35><Extra-
    PV1.36 xsi:nil="true"></Extra-
    PV1.36><Extra-
    PV1.37 xsi:nil="true"></Extra-
    PV1.37><Extra-
    PV1.38 xsi:nil="true"></Extra-
    PV1.38><Extra-
    PV1.39 xsi:nil="true"></Extra-
    PV1.39><Extra-
    PV1.40 xsi:nil="true"></Extra-
    PV1.40><Extra-
    PV1.41 xsi:nil="true"></Extra-
    PV1.41><Extra-
    PV1.42 xsi:nil="true"></Extra-
    PV1.42><Extra-
    PV1.43 xsi:nil="true"></Extra-
    PV1.43><Extra-
    PV1.44>20070705154838+0000</Extra-
    PV1.44><Extra-
    PV1.45 xsi:nil="true"></Extra-
    PV1.45><Extra-
    PV1.46 xsi:nil="true"></Extra-
    PV1.46><Extra-
    PV1.47 xsi:nil="true"></Extra-
    PV1.47><Extra-
    PV1.48 xsi:nil="true"></Extra-
    PV1.48><Extra-
    PV1.49 xsi:nil="true"></Extra-
    PV1.49><Extra-
    PV1.50 xsi:nil="true"></Extra-
    PV1.50><Extra-
    PV1.51>V</Extra-
    PV1.51><Extra-
    PV1.52 xsi:nil="true"></Extra-
    PV1.52></Extra-
    PV1><Extra-
    ORC><Extra-
    ORC.1>NW</Extra-
    ORC.1><Extra-
    ORC.2><Extra-
    ORC.2.1>19013</Extra-
    ORC.2.1><Extra-
    ORC.2.2>ALERT</Extra-
    ORC.2.2></Extra-
    ORC.2><Extra-
    ORC.3 xsi:nil="true"></Extra-
    ORC.3><Extra-
    ORC.4 xsi:nil="true"></Extra-
    ORC.4><Extra-
    ORC.5>NW</Extra-
    ORC.5><Extra-
    ORC.6 xsi:nil="true"></Extra-
    ORC.6><Extra-
    ORC.7 xsi:nil="true"></Extra-
    ORC.7><Extra-
    ORC.8 xsi:nil="true"></Extra-
    ORC.8><Extra-
    ORC.9 xsi:nil="true"></Extra-
    ORC.9><Extra-
    ORC.10 xsi:nil="true"></Extra-
    ORC.10><Extra-
    ORC.11 xsi:nil="true"></Extra-
    ORC.11><Extra-
    ORC.12><Extra-
    ORC.12.1>4292</Extra-
    ORC.12.1><Extra-
    ORC.12.2>Martinez</Extra-
    ORC.12.2><Extra-
    ORC.12.3>Cristina</Extra-
    ORC.12.3></Extra-
    ORC.12><Extra-
    ORC.13 xsi:nil="true"></Extra-
    ORC.13></Extra-
    ORC><Extra-
    OBR><Extra-
    OBR.1>1</Extra-
    OBR.1><Extra-
    OBR.2><Extra-
    OBR.2.1>19013</Extra-
    OBR.2.1><Extra-
    OBR.2.2>ALERT</Extra-
    OBR.2.2></Extra-
    OBR.2><Extra-
    OBR.3 xsi:nil="true"></Extra-
    OBR.3><Extra-
    OBR.4><Extra-
    OBR.4.1>10781</Extra-
    OBR.4.1><Extra-
    OBR.4.2>M<escape V="XE3"/>o direita, duas incid<escape V="XEA"/>ncias</Extra-
    OBR.4.2><Extra-
    OBR.4.3>CHVNG</Extra-
    OBR.4.3></Extra-
    OBR.4><Extra-
    OBR.5 xsi:nil="true"></Extra-
    OBR.5><Extra-
    OBR.6 xsi:nil="true"></Extra-
    OBR.6><Extra-
    OBR.7 xsi:nil="true"></Extra-
    OBR.7><Extra-
    OBR.8 xsi:nil="true"></Extra-
    OBR.8><Extra-
    OBR.9 xsi:nil="true"></Extra-
    OBR.9><Extra-
    OBR.10 xsi:nil="true"></Extra-
    OBR.10><Extra-
    OBR.11 xsi:nil="true"></Extra-
    OBR.11><Extra-
    OBR.12 xsi:nil="true"></Extra-
    OBR.12><Extra-
    OBR.13 xsi:nil="true"></Extra-
    OBR.13><Extra-
    OBR.14 xsi:nil="true"></Extra-
    OBR.14><Extra-
    OBR.15 xsi:nil="true"></Extra-
    OBR.15><Extra-
    OBR.16><Extra-
    OBR.16.1>4292</Extra-
    OBR.16.1><Extra-
    OBR.16.2>Martinez</Extra-
    OBR.16.2><Extra-
    OBR.16.3>Cristina</Extra-
    OBR.16.3></Extra-
    OBR.16><Extra-
    OBR.17 xsi:nil="true"></Extra-
    OBR.17><Extra-
    OBR.18 xsi:nil="true"></Extra-
    OBR.18><Extra-
    OBR.19 xsi:nil="true"></Extra-
    OBR.19><Extra-
    OBR.20 xsi:nil="true"></Extra-
    OBR.20><Extra-
    OBR.21 xsi:nil="true"></Extra-
    OBR.21><Extra-
    OBR.22 xsi:nil="true"></Extra-
    OBR.22><Extra-
    OBR.23 xsi:nil="true"></Extra-
    OBR.23><Extra-
    OBR.24 xsi:nil="true"></Extra-
    OBR.24><Extra-
    OBR.25 xsi:nil="true"></Extra-
    OBR.25><Extra-
    OBR.26 xsi:nil="true"></Extra-
    OBR.26><Extra-
    OBR.27><Extra-
    OBR.27.1 xsi:nil="true"></Extra-
    OBR.27.1><Extra-
    OBR.27.2 xsi:nil="true"></Extra-
    OBR.27.2><Extra-
    OBR.27.3 xsi:nil="true"></Extra-
    OBR.27.3><Extra-
    OBR.27.4>20070705161237+0000</Extra-
    OBR.27.4></Extra-
    OBR.27><Extra-
    OBR.28 xsi:nil="true"></Extra-
    OBR.28></Extra-
    OBR><Extra-
    NTE><Extra-
    NTE.1>1</Extra-
    NTE.1><Extra-
    NTE.2 xsi:nil="true"></Extra-
    NTE.2></Extra-
    NTE><Extra-
    DG1><Extra-
    DG1.1>1</Extra-
    DG1.1><Extra-
    DG1.2 xsi:nil="true"></Extra-
    DG1.2><Extra-
    DG1.3><Extra-
    DG1.3.1>9233</Extra-
    DG1.3.1><Extra-
    DG1.3.2>Contusao De Dedo Da Mao</Extra-
    DG1.3.2><Extra-
    DG1.3.3>ICD9</Extra-
    DG1.3.3></Extra-
    DG1.3><Extra-
    DG1.4 xsi:nil="true"></Extra-
    DG1.4><Extra-
    DG1.5 xsi:nil="true"></Extra-
    DG1.5><Extra-
    DG1.6>D</Extra-
    DG1.6></Extra-
    DG1></OMG_O19>
    I think that the problem should be because of the "Extra" (eg. <Extra-
    PID.1 xsi:nil="true">) word that B2B puts in every tag.
    The strange thing is that, this already worked until two days ago....
    What could it be?
    Thanks for your help.
    Best Regards,
    Nuno Fernandes

  • XML DOM Parsing getAttributes() in J2SE 5.0 vs. J2SE 1.4

    I am experiencing the following problem, with the Node.getAttributes() function although the following code runs fine under Java 1.4, and getAttributes() returns the actual string attribute values:
                File xmlFile = new File(fileName);
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = factory.newDocumentBuilder();
                Document doc = builder.parse(xmlFile);
                // Begin analyzing XML
                Element root = doc.getDocumentElement();
                // Enumerate all children
                NodeList children = root.getChildNodes();
                    Node rootNode = null;
                    NodeList nodeList = children;
                    for (int R = 0; R < nodeList.getLength() ; R++)
                        if (nodeList.item(R).getNodeType() == Node.ELEMENT_NODE)
                            rootNode = nodeList.item(R);
                            System.out.println("> " + rootNode.getNodeName() + " - " + rootNode.getAttributes().toString());
                 In J2SE 5.0 the Node.getAttributes() returns the following:
    [email protected]d of returning then the actual attribute string (like in Java 1.4)!
    If it helps at all I am using DOM parser (as noticed above, org.w3c.dom)
    My assumption is that J2SE 5.0 returns an attribute map that is encoded differently then Java 1.4
    Thank you for your time & appreciate any help...

    The getAttributes method returns a NamedNodeMap.
    Iterate over the NamedNodeMap to get attribute values.
    Instead of rootNode.getAttributes().toString();
    NamedNodeMap map=rootNode.getAttributes().toString();
    for(int i=0; i<map.getLength(); i++){
    Node node=map.item(i);
    if(node.getNodeType()==Node.ATTRIBUTE_NODE)
    System.out.println("Attribute Node "+node.getNodeName()+ "has value "+ node.getNodeValue());
    }

  • Parsing an XML using DOM parser in Java in Recursive fashion

    I need to parse an XML using DOM parser in Java. New tags can be added to the XML in future. Code should be written in such a way that even with new tags added there should not be any code change. I felt that parsing the XML recursively can solve this problem. Can any one please share sample Java code that parses XML recursively. Thanks in Advance.

    Actually, if you are planning to use DOM then you will be doing that task after you parse the data. But anyway, have you read any tutorials or books about how to process XML in Java? If not, my suggestion would be to start by doing that. You cannot learn that by fishing on forums. Try this one for example:
    http://www.cafeconleche.org/books/xmljava/chapters/index.html

  • DOM Parsing Not working in Applet.

    Hi,
    I ve an applet (parserapplet)which contains the DOM parsing. So xalan.jar(nearly 780 kb) required to assist the parsing. I gave archive="xalan.jar" in My html file. But the jar file is not downloaded from the archive tag. and ClassnotFoundException is thrown.
    the exact exception is:
    ======================
    com.ms.security.SecurityExceptionEx[Host]: cannot access file C:\WINNT\Java\lib\jaxp.properties
         at com/ms/security/permissions/FileIOPermission.check
         at com/ms/security/PolicyEngine.deepCheck
         at com/ms/security/PolicyEngine.checkPermission
         at com/ms/security/StandardSecurityManager.chk
         at com/ms/security/StandardSecurityManager.checkRead
         at java/io/File.exists
         at javax/xml/parsers/DocumentBuilderFactory.findFactory
         at javax/xml/parsers/DocumentBuilderFactory.newInstance
         at parserapplet.parseXMLMessage
         at parserapplet.init
         at com/ms/applet/AppletPanel.securedCall0
         at com/ms/applet/AppletPanel.securedCall
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run
    javax.xml.parsers.FactoryConfigurationError: java.lang.ClassNotFoundException: org/apache/crimson/jaxp/DocumentBuilderFactoryImpl
         at javax/xml/parsers/DocumentBuilderFactory.newInstance
         at parserapplet.parseXMLMessage
         at parserapplet.init
         at com/ms/applet/AppletPanel.securedCall0
         at com/ms/applet/AppletPanel.securedCall
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run
    I know signing the applet a bit. But though it is signed , second exception is constantly thrown. so please write in detail the procedure to sign the applet. and how to download xalan.jar in html page etc.,
    I require how to download the jar files, and after the completion of downloading of the jar files only, the applet should get executed. or shall i use different jar file(like crimson.jar?). This is urgent requirement.Please help me.!
    the classes for the parsing are not at all downloaded and hence the problem.
    help me reg that.
    thank you in advance/.
    Prasanna kumar k.

    Hello Prasanna kumar k.
    First you should sign your jar files (xerces.jar crimson.jar and xalan.jar) and recreate a cab files
    xerces.cab crimson.cab xalan.cab. To do that you should download sdk for java from microsoft .
    create testkey named testkey.pvk
    1. makecert -sv testkey.pvk -n "CN=your name" test.cer
    convert to public key
    2. cert2spc test.cer test.spc :
    create cab file
    3. cabarc -p -c -r -s 6144 test.cab
    sign the cab file
    4. signcode -j java.dll -jp -low -spc -v testkey.pvk -n test.cab
    after that you should use thia files in html:
    <!doctype html public "//W3//DID HTML 3.2 Final//EN">
    <HTML>
    <HEAD>
    <META content="text/html; charset=iso-8859-1">
    <TITLE>IBM Host On-Demand 6.0</TITLE>
    </HEAD>
    <BODY BACKGROUND="mankolpr/custom/img/Drawing1.gif">
    <CENTER>
    <IMG src="mankolpr/custom/img/images/ot_hod_log.gif">
    <P>
    <APPLET archive="crimson.jar,xerces.jar,xalan.jar" CODE="test.class" WIDTH=584 HEIGHT=450>
    <PARAM NAME=cabinets VALUE=crimson.cab,xerces.cab,xalan.cab>
    <PARAM NAME=background VALUE="pink">
    <p>If you are reading this message, your client platform is not capable of running
    IBM Host On-Demand. To run IBM Host On-Demand, you must have a Java-enabled web
    browser such as Netscape Navigator or Microsoft Internet Explorer.
    </APPLET>
    </CENTER>
    </BODY>
    </HTML>
    Best Regards,
    Tzur Emzari
    Project Manager
    Local Authority Data Processing Center LTD
    ISRAEL
    Tel : 972-4-8615754, Fax : 972-4-8661977
    Cell : 972-53-532448
    [email protected] <mailto:[email protected]>

  • Vc webdynpro DOM parsing

    hello there
    i tryed the DOM parsing on the returned paramter from the <u>portal eventing</u>
    between<u> visual composer and webdynpro</u> and i get this error :
    <b>com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here:
    (hex) 25, 33, 43(:main:,row:1,col:3</b>
    the ascii code from the visual composer in dataObject is:
    %3CParamas%20version%3D%222%22%20%3E%3CRow%20STR1%3D%22test1%22%20/%3E%3C/Params%3E
    the xml code of dataObject string is:
    <b><Params version="2"><Row STR1="test1"\><\Params></b>
    the java code is:
    // Create a Dom parser
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    DocumentBuilder docBuilder = factory.newDocumentBuilder();
    // Parse input to create document tree
    StringReader s = new StringReader(dataObject);
    InputSource is = new InputSource(s);
    Document doc = docBuilder.parse(is);

    thanx but i fixed the problem my self the problem was in visual composer out put xml its sent a '/' insted of '\' in the xml syntax

Maybe you are looking for

  • Acrobat 9 hangs with multiple documents open

    HP pro 6200 4 G RAM, Win7Pro, Acrobat 9(fully updated), single computer affected, multiple users, documents are from C drive, network, and USB I've run a repair install, removed the popups/lines and other markup notifications, held shift down when st

  • BEA-382500: ALSB Service Callout action received SOAP Fault response

    Hi Friends... <BR> <BR> <BR> During the implementation of TUTORIAL: 2 Loan Example of AquaLogic Service Bus 2.1, I am getting fault response when testing the Proxy Service. Please help me in the following.... <BR> <BR> <BR> <b>BEA-382500: ALSB Servic

  • Trying to check eligibility for iPhone purchase

    From the Store, Im trying to "Get Started" on checking my eligibility for the $99 iPhone model. However, when I enter my address to go to the next step, it continuously comes back that it cannot find my address. I've tried several variations (numbers

  • Portlet question- session.invalidate()- with weblogic

    Guys: Has anyone had a issue with session.invalidate() using weblogic 8.1. we have vignette and weblogic 8.1. the problem i have noticed is session.getId retunrns a extra timestamp string in the end. And i am thinking since this changes the entire se

  • LabVIEW RunTime into xp embedded image

    Hello, I need to integrate the LabVIEW 2009 Runtime into an XP Embedded image. That means I have to create a LabVIEW RunTime Component (SLD File) for the XPe Target Designer. Installing LabVIEW RunTime on the target does not work for me. Is there a s