Invalid XML document - "&" character in dp-xml

Hi guys,
Do anyone know how to avoid XML parser exception
in admin console throwed because one of the
attributes in dp.xml has "&" sign in the value string (e.g. URL) ?!
PS: I am talking about editing dp xml via amconsole.
Thanks,
Alex :-)

Did this work for you? When I try & amp; it works the first time, but when I go back in to edit, it's resolved back to plain '&' and gets an error again. I certainly don't want to change it every time! Same thing happened with the entity reference.
When I use '%26', it doesn't resolve in the browser view.
Thanks,

Similar Messages

  • An invalid XML character (Unicode: 0x0) was found in the prolog of the docu

    Hi folks,
    I'm using the SAX parser to parse a small xml file. If I use that file in IE, there its parsing correctly and displaying the xml in the tree structure.
    But in my Java code its throwing
    org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found in the prolog of the document.
    The xml parsing code of my program is
    XMLReader parser = XMLReaderFactory.createXMLReader(
    "org.apache.xerces.parsers.SAXParser");
    HelpPartHandler hp = new HelpPartHandler();
    parser.setContentHandler(hp);
    RandomAccessFile raf = new RandomAccessFile("sample.xml","r");
    byte Contents[] = new byte[(int)raf.length()];
    StringReader sr = new StringReader(new String(Contents));
    InputSource is = new InputSource(sr);
    parser.parse(is);
    The xml file is
    <?xml version="1.0"?>
    <ROOT>
    <NODE> Java </NODE>
    </ROOT>
    Please let me know the mistakes what I have done. Looking for the reply.
    Thanks in Advance
    Prabu

    The message seems clear to me. Your document contains a null character, which is not valid in an XML document. Take it out of the document, and change whatever produced the document to not put it there. (I hope you don't consider Microsoft software to be standards-compliant.)

  • Com.sap.aii.utilxi.misc.api.BaseRuntimeException:An invalid XML character (Unicode: 0x1f) was found in the element content of the document

    Hi,
    I'm getting the below runtime exception during IDOC- SOAP message mapping in Integration engine.
    "Runtime exception occurred during application mapping com/sap/xi/tf/<<<\\Message mapping object name\\>>>; com.sap.aii.utilxi.misc.api.BaseRuntimeException:An invalid XML character (Unicode: 0x1f) was found in the element content of the document"
    I have no clue why this exception occurs. Could anyone say the reason of the exception?
    Thanks!
    Regards,
    Gopi

    Hi Gopinath
    Check this thread
    An invalid XML character (Unicode: 0x1d) was found in the element
    Kind regards
    Javi

  • Error in moni as invalid XML character (Unicode: 0x16) was found

    Hello Experts,
    I am facing an issue in Production interface is Proxy - -> JDBC data is passing in ECC successfully in PI moni it is showing error
    as                  Runtime Exception when executing application mapping program com/sap/xi/tf/_MaterialPlantFromSAP_to_MaterialPlantToDYNAMINE_; Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; An invalid XML character (Unicode: 0x16) was found in the element content of the document.
    when i try to open the payload it is showing data is too long when i click on open screen is getting hang showing as not responding.I have checked in the ECC it is also showing data is too long when i click on open after 1 min payload is opening when i try to copy the payload and paste in Message mapping test tab again screen is getting hanging when i try to test with 20 or 30 records in Mapping it going through.
    I have downloaded that XML file from ECC moni it is 8.83 MB .
    PI can process this huge file ? please suggest me how to pass data in chunks .And also i am not understanding error is due to Payload has not correct data or Payload is huge.
    Please throw some light on the issue any help is highly appreciated.
    Regards
    Praveen Reddy

    Hi Praveen,
                       you need a HEX editor. Please download one from this link
    http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm
    Here in the editor search for the HEX value 0X16 and see the corrosponding charcater in payload.
    Try getting rid of the character before it reaches Integrtaion engine possibly with java mapping.
    Regards
    Anupam
    Edited by: anupamsap on Jan 4, 2012 6:43 PM

  • Character reference "&#0" is an invalid XML character

    Hi When I am trying to parse the XMl using SAX , its giving me the following FATAL error
    FATAL Error while validating the XML document:
    Character reference "&#0" is an invalid XML character
    Pl shelp me to resolve this

    My xml file contains illegal char such as 0x00 0x10 am trying to
    remove them and replace them with " &#14 or &#16" he SAX parser says " &#14 or &#16" an illegal inavlid char.
    What would be the probable solution for this.
    Thanks
    Naveen
    Message was edited by:
    Naveen_Ratkal

  • Fix Invalid XML character (Unicode: 0x1c) before xml data parsing

    How to fix the error :- "An invalid XML character (Unicode: 0x1c) was found in the element content of the document."
    This error message is generated before parsing of xml data.
    So how to filter the unwanted characters like 0x1c during XML file generation?

    ASCII has nothing to do with it. XML is a text format and so an XML file may only include text characters. 0x7 isn't a text character, it's a control character, and it isn't allowed to occur in an XML file.
    As for how to identify which character is causing the problem, the error message tells you that.

  • Invalid XML character in castor XML

    I am using castor API for converting an object into XML. When I marshal the object, following exception occur:
    java.io.IOException: The character '' is an invalid XML character
         at org.apache.xml.serialize.BaseMarkupSerializer.characters(Unknown Source)
         at org.exolab.castor.xml.Marshaller.marshal(Unknown Source)
         at org.exolab.castor.xml.Marshaller.marshal(Unknown Source)
         at org.exolab.castor.xml.Marshaller.marshal(Unknown Source)
    Following is the code snippet which I am using:
    StringWriter writer = new StringWriter(500);
    Marshaller marshal = new Marshaller(writer);
    marshal.setEncoding("windows-1251"); //I have tried all these encodings as well: UTF-8, UTF-7, ASCII, ISO-8859-1, ISO-8859-5, windows-1251
    //marshal.marshal(token, writer);     // This is commented, since the encoding is not applied if I use this method, next statement works fine
    marshal.marshal(token);Here, token is the object which I am trying to marshal. I have tried different encodings, but the problem is not resolved. Could anyone help?
    Castor reference:
    [http://www.castor.org/xml-framework.html ]

    Do you want this encoding to be reversible? For example, that character \u001b which is in the string. You have to represent it by something different in your XML. If you want to get the same thing back when you convert your XML back into Java, then you can't just translate that character into an existing character, because then you have lost information. You have to translate it into some special series of codes. And then when you convert the XML back, you have to recognize that special series of codes and convert that into the \u001b character.
    So yeah, you could write your own custom encoding which did that. I'm not aware of any existing software that does that; it wouldn't be very useful, because it would result in XML documents which used non-standard encodings and hence couldn't be sent to anybody else.

  • Handle invalid xml character while serializing

    I have requirement where I need to serialize a document which contains a string like "ンᅧᅭ%ンᅨ &amp;". While serializing it throws the following exception
    java.io.IOException: The character ' ' is an invalid XML character
    Is there a way we can serialize this String as is with any workaround.
    StringWriter stringOut = new StringWriter();
      DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
      Document doc = docBuilder.newDocument();
      Element rootElement = doc.createElement("company");
      doc.appendChild(rootElement);
      String xml = "ンᅧᅭ%ンᅨ &amp;";
      //String xml = "ンᅧᅭ%ンᅨ &amp;";
      Element junk = doc.createElement("replyToQ");
      junk.appendChild(doc.createCDATASection(xml));
      //junk.appendChild(doc.createTextNode(stripNonValidXMLCharacters(xml)));
      rootElement.appendChild(junk);
      //org.w3c.dom.Document doc = this.toDOM();
      //Serialize DOM
      OutputFormat format = new OutputFormat(doc,"UTF-8",true);
      format.setIndenting(false);
      format.setLineSeparator("");
      format.setPreserveSpace(true);
      format.setOmitXMLDeclaration(false);
      XMLSerializer serial = new XMLSerializer( stringOut, format );
      // As a DOM Serializer
      serial.asDOMSerializer();
      serial.serialize( doc.getDocumentElement() );

    As a guess because you are treating CDATA as meaning the same as 'binary' which it isn't.  The characters in CDATA still must be valid XML characters.
    If you want binary data then base64 encode it and put that in the document - and you won't need CDATA at all then, it will just be regular element text.

  • Getting invalid xml character while marshalling

    Hi
    I have a text which contains all characters including some special chars.I am replacing the html codes for &,>,<,\," characters. I am building the xml file and trying to marshall it. But i am getting "The character '' is an invalid XML character". I am using castor-0.9.6.jar. Can any one tell me how can i handle special chars like � is easy way rather than repacing each and every character.
    Please let me know why i am getting the above error (is the special char end of file char. actually i am reating from string not from file).
    Thanks & Regards,
    Prasanth

    As a guess because you are treating CDATA as meaning the same as 'binary' which it isn't.  The characters in CDATA still must be valid XML characters.
    If you want binary data then base64 encode it and put that in the document - and you won't need CDATA at all then, it will just be regular element text.

  • How to filter invalid XML character

    I need to form an XML document in the program. There are some invalid characters like 0x8.
    How can I remove the invalid XML characters?
    Is there any existing tool (function) I can use to check whether the character is an invalid or valid XML character?
    Thank you.
    waterii

    you can set dataProvider filterFunction to filter the data
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/collections/ListColl ectionView.html#filterFunction

  • BAPI_PO_GETDETAIL1 - An invalid XML character (Unicode: 0xb) was found

    Hi,
    We are using BAPI_PO_GETDETAIL1 to get the Purchase Order details. it worked well in the past.
    But its failing for a particular PO number.
    Error Message:An invalid XML character (Unicode: 0xb) was found in the element content of the document.
    I understand there might be some special character in the record. But it works well at SAP ECC.
    Can someone please suggest some solution or workaround?
    Thanks,
    Anil

    Hi,
    I faced the same issue recently, and came accross this sap note : 1559677 : XML renderer creates invalid XML.
    Take a few moments to read the contents, but here's the most important part :
    If an application program uses the SAP XML renderers to create XML 1.0
    documents that must strictly conform to the specifications of W3C, this
    application program must ensure that problematic characters are removed
    from the data before transferring this data to the SAP XML renderer.
    So, you need to clean up the characters by yourself...
    Best regards,
    Wouter

  • An invalid XML character (Unicode: 0xc)

    Hello all...
    I am trying to build an XML document from a database query (SQL Server)... using Apache's Xalan/Xerces xml/xsl parser.... and the Xerces keeps throwing this exception:
    An invalid XML character (Unicode: 0xc) was found in the element content of the document.
    when looking at the content... I do find some unicode characters: ��
    My XML header is set to:
    <?xml version="1.0" encoding="ISO-8859-1"?>but it seems to have no influence. I tried (just for troubleshooting) to enclose the field in a <![CDATA[]]> block, but it threw the same error.
    I am using org.apache.xerces.parsers.DOMParser to parse the XML.
    My parsing code looks like this:
    DOMParser parser = new DOMParser();
    parser.parse(new InputSource(new StringReader(xml)));is there something else I am missing?

    Open it with your text editor.Try to save it in the
    Unicode format. I also suggest you to check out:
    http://www.w3schools.com/xml/xml_encoding.asp
    Hello! Thanks for the response... I found the error, something that wasn't immediately related to Java... the front-end application is Cold Fusion... and the connection to SQL Server was via ODBC... and something strange was happpening to the translation of the copyright character... where is was indeed invalid.
    Cold Fusion on Win2k is unicode compliant, but there appears to be something odd with the ODBC driver.
    Thanks again

  • An invalid XML character (Unicode: 0x15) was found  ERROR

    I AM TRYING TO USE JAXB TO UNMARSHAL XML FILE AND GET FOLLOWING ERROR.
    PLEASE HELP.
    THANKS IN ADVANCE
    [java] org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x15) was found in the element content of the document.
    [java] DefaultValidationEventHandler: [FATAL_ERROR]: An invalid XML character (Unicode: 0x15) was found in the element content of the document.
    [java] Location:
    [java]      at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
    [java]      at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:213)
    [java]      at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:385)
    [java]      at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:315)
    [java]      at org.apache.xerces.impl.XMLScanner.reportFatalError(XMLScanner.java:1294)
    [java]      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1500)
    [java]      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:348)
    [java]      at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:539)
    [java]      at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:595)
    [java]      at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
    [java]      at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1125)
    [java]      at grants.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:142)
    [java]      at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:131)
    [java]      at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:178)
    [java]      at Transfer.main(Transfer.java:20)

    You made the file? Then fix the program that makes it so that it doesn't put that character into the file. Standard XML processors like those used by JAXP will never create invalid XML, so why not use them?

  • An invalid XML character (Unicode: 0x1d) was found in the element

    Hi Guys,
      i am getting below error in moni,
       An invalid XML character (Unicode: 0x1d) was found in the element content of the document
       when i am taking source payload from moni and i tried to test with payload in mapping also i am getting same error.
       Can any one help me on this...
    Thanks,
    Siva.

    Hi Stefan,
       This is my source xml in moni..
    xmlns:prx="urn:sap.com:proxy:ECP:/1SAI/TAS5BFDF495190544E4B506:701:2008/06/06">
      <SiteId>0080</SiteId>
      <UCC>42027519 91029010015</UCC>
    My interface is SAP(Proxy) to Database(Synchronous).
       SAP (PROXY) --> PI --> DATABASE ( Synchronous Communication )
    Let me know if u need any information from my side...
    Thanks for ur help...
    Thanks,
    Siva..

  • Org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x80) was found in the CDATA section

              Hi,
              I,'m using c.tld tag libraries from Yakarta in order to use c:if functions.
              When I use non-unicode characters in my JSP pages, it crashes:
              java.io.IOException: javax.servlet.jsp.JspException: The taglib validator rejected
              the page: "org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x80)
              was found in the CDATA section., "
                   at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:124)
                   at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
                   at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:353)
                   at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:211)
                   at weblogic.servlet.jsp.JspStub.checkForReload(JspStub.java:149)
                   at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:521)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:351)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
                   at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5445)
                   at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
                   at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3105)
                   at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2588)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
              How can I force it to use ISO-8859-1? All my tries haven't work. What should I
              do? The c.tld libraries and jars are taken from JDK 1.4.1_02
              

    Hi Stefan,
       This is my source xml in moni..
    xmlns:prx="urn:sap.com:proxy:ECP:/1SAI/TAS5BFDF495190544E4B506:701:2008/06/06">
      <SiteId>0080</SiteId>
      <UCC>42027519 91029010015</UCC>
    My interface is SAP(Proxy) to Database(Synchronous).
       SAP (PROXY) --> PI --> DATABASE ( Synchronous Communication )
    Let me know if u need any information from my side...
    Thanks for ur help...
    Thanks,
    Siva..

  • Invalid XML character in web service answer of MS Exchange

    Hello Forum!
    We have to look up contacts in the global address list of a Microsoft Exchange server.
    The current solution uses the web services that have been introduced in version 2007 of MS Exchange.
    Unfortunately some records returned by the MS Server cause a javax.xml.stream.XMLStreamException. The Exception
    tells us that a parser error occurred. The Exception says:
    Message: Character reference "&#x7" is an invalid XML character.
    The Java classes used for accessing the Exchange web services are generated using the jaxws plugin and the application
    is running on the Glassfish application server v2 ur1.
    The only solution we can think of right now is to access the XML stream returned by the Exchange server before it is handed over
    to the parser in order to replace the invalid characters.
    Can anyone point me to some documentation or give me an example of how to intercept the XML parsing process used by the jaxws
    component?
    Any other ideas for a solution are of course also appreciated.
    Thanks for your help in advance,
    Henning Malzahn

    hm@collogia wrote:
    In addition to that MS is not very responsive when it comes to Java questions.Yes, but "Your software is producing malformed XML" is not a Java question.
    I can imagine that filtering the stream isn't very easy - are you able to provide some links to additional
    information that can help us getting started in that direction?A subclass of FilterInputStream whose read() method calls the superclass's read() method a second time when the input is between 0 and 19, or whatever are the invalid XML characters?

Maybe you are looking for