Invalid XML generated

I thought I was figuring this stuff out, but I guess not. I've generated an xml
instance using xmlBeans. When I check it with the validate() method, it comes
back 'true' or valid. But if I run the Xerces sample app, counter, against it,
I get the following errors:
java sax.Counter -v output.xml[Error] output.xml:2:14: Document is invalid: no grammar found.
[Error] output.xml:2:14: Document root element "ns1:Envelope", must match DOCTYP
E root "null".
output.xml: 280 ms (22 elems, 0 attrs, 0 spaces, 343 chars)
I've attached the xml file I generated using:
InputStream IS = envelope.newInputStream(xo);
FileOutputStream FOS = new FileOutputStream("output.xml");
byte[] transfer = new byte[2048];
int count = 0;
while ( ( count = IS.read(transfer)) != -1 )
FOS.write(transfer, 0, count);
Ken.
[output.xml]

For some reason when I use MapForce tool to generate my xslt mapping source, it is generating the following statement in the xsl file.
     <xsl:namespace-alias stylesheet-prefix="n" result-prefix="#default"/>
So at the root element of XML file, it is replacing the character n with '#default' for some reason, I don;t know the purpose of this.
As you suggested, I changed the name space, still I experienced same problem.
It is now resolved after removing the above xsl statement from the xsl file before creating/uploading the relevant zip file into archives folder.
It works fine now. Thanks for the clue.

Similar Messages

  • Missing xsi:type, invalid xml generated, jaxb 1.6

    Hi,
    i've this XML Schema defined for my doc/lit web service:
    <complexType name="CasDataType">
      <sequence>
        <element name="key"  type="long"  nillable="false  minOccurs="1" maxOccurs="1"/>
      </sequence>
    </complexType>
    <complexType name="AddressDataType">
      <complexContent>
        <extension base="tns:CasDataType">
          <sequence>
            <element name="FirstName"  nillable="true" minOccurs="0" type="string"/>
            <element name="LastName"  nillable="true" minOccurs="0" type="string"/>
          </sequence>
        </extension>
      </complexContent>
    </complexType>If i create a AddressDataType and return it with my web service, the jaxb-marshaller generates this xml code:
    <casDataTypes>
          <key>123</key>
          <FirstName>Ingo</FirstName>
          <LastName>Siebert</LastName>
    </casDataTypes>But correct would be this:
    <casDataTypes xsi:type="AddressDataType" >
          <key>123</key>
          <FirstName>Ingo</FirstName>
          <LastName>Siebert</LastName>
    </casDataTypes>Is this error already known?
    Is it fixed with jaxb 2.0?
    I doesn't like annotations, is it possible with jaxb 2.0 (XJC task) to geneate files without annotations?
    Cheers,
    Ingo

    Not got a single answer , surprise whether the question is too dumb to ask or JAXB doesn't support feature or my requirement is weird :-) ... in any case let me know please
    regards

  • GetXMLSchema java method generates invalid XML Schema document

    Hi all,
    I managed to get the xdk FAQ demo to work eventually on oracle 9.2.0.1.0 for windows, I noticed however that when I generate an XML Schema definition against a query, the document contains an outdated namespace declaration (minor flaw) and "nullable" attributes instead of "nillable", resulting in an invalid XML Schema document when edited with certain tools like Altova's XmlSpy.
    How can I fix this?
    See below for the XML Schema source.
    Bye,
    Flavio
    <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">
    <xsd:element name="ROWSET">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="ROW" minOccurs="0" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="CATEGORY" type="xsd:string" minOccurs="0"/>
    <xsd:element name="QUESTION" type="xsd:string" minOccurs="0"/>
    <xsd:element name="ANSWER" type="xsd:string" minOccurs="0"/>
    <xsd:element name="LANGUAGE" type="xsd:string" minOccurs="0"/>
    <xsd:element name="SENDBY" type="xsd:string" nullable="true" minOccurs="0"/>
    <xsd:element name="CREATETIME" type="xsd:string" minOccurs="0"/>
    </xsd:sequence>
    <xsd:attribute name="num" type="xsd:integer"/>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>

    With my (trial) copy of XMLSPY (version 2004 rel.3), I get following pop-up when opening that schema:
    "This schema is written in an old standard:
    http://www.w3.org/2000/10/XMLSchema
    Do you want XMLSPY to convert it to the new one:
    http://www.w3.org/2001/XMLSchema"
    When I click "Yes" and save, I get a perfectly valid schema (with nullable replaced by nillable).

  • 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..

  • How to catch invalid XML inside orchestration

    I have an Passthrough Pipeline and passing an invalid XML , I am unable to capture inside an orcestration.
    I get the error -
    The published message could not be routed because no subscribers were found.
    If i pass valid XML orchestration picks up and process it.    Is there any way to capture this in orchestration
    Regards
    Suresh

    I believe your orchestration will have a Typed Schema, therefore the subscription of Orchestration will be as below-
    ReceivePortID == [Port ID] and MessageType == [MessageType of your msg at first Receive Shape]
    So when you are using XML Receive Pipeline it promotes the MessageType element in the incoming message
    which helps in satisfying the above filter.
    However if you use PassThrough pipeline it doesn't touches the incoming message at all and thus no MessageType
    was not promoted so the above filter condition is not met.
    If you want to receive Untyped Message in Orchestration you will have to create a msg of type System.XML.XMLDocument
    and assign it to first receive shape.
    This will generate filter condition as- ReceivePortID
    == [Port ID], without MessageType, which will allow orchestration to subscribe your message
    Thanks,
    Prashant
    Please mark this post accordingly if it answers your query or is helpful.

  • 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?

  • Javax.xml.parsers.DocumentBuilder to skip invalid XML characters?

    Hi,
    I convert XML files into flat files. In doing so I call the API DocumentBuilder.parse(File f). If the XML file f contains an invalid XML character, the API throws a SAXException.
    My question is: while I know that certain invalid XML chars are not part of the data and therefore can be safely ignored in the conversion, is there a way to tell the API to skip those chars?

    Nope. Compliant XML parsers are required to parse the XML as it is and not to "repair" it in any way. Your best option is not to have badly-formed XML in the first place, so if you are the one generating the XML, you should fix that process. But if you have bozo customers generating it, and you can't make them do it right, then pre-process the XML to drop the bad characters.

  • 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

    Hi,
    I'm adding new functionality to an existing code. It generates an XML page with additional fields. It was working fine, when I added new fiels to this web page I'm getting the following error.
    I'm new to this and I don't know how to pin point the error.
    can any one please help me.
    Input XSL: 1, 20788: Invalid XML character. (Unicode: 0x1a)
    Input XSL: 1, 20956: Invalid XML character. (Unicode: 0x1a)
    Input XSL: 1, 21190: Invalid XML character. (Unicode: 0x1a)
    Input XSL: 1, 21370: Invalid XML character. (Unicode: 0x1a)
    thanks,

    I tried this but still no luck.
    int j = 0xa1, i;
                   while ((i = dis.readByte()) != -1) {
                        if (i == j) {
                             System.out.print("got it");
                             break;
                        } else {
                             System.out.print((char) i);
    [\code]
    thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Mapping error: Character reference "&# 00" is an invalid XML character

    Hi All,
      Iam performing the RFC(R/3) -> PI(7.1) -> SOAP (third party software) ; Synchronous scenario.
    The messages are reaching the PI server , but the a mapping errors is occurring due to dummy characters ""& #00" been sent to the XI system.
    Is this due to the R/3 sending the invalid characters or these been generated in PI system. Would you suggest any notes,patches to resolve the issue?
    "MAPPING">EXCEPTION_DURING_EXECUTE
    com.sap.aii.utilxi.misc.api.BaseRuntimeException:
    Character reference "& # 00" is an invalid XML character
    Many thanks!
    guru

    Hi,
    If you go through this link last page and last para, which says..
    "The only solution is to use a Java mapping before the actual mapping to perform the escaping."
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Regards,
    Sarvesh

  • Invalid xml character(0x0)

    Hi All,
    I am generating an xml file using JAXB using ISO-8859-1 encoding.
    While parsing that xml file using XmlReader , I am getting exception as "UnmarshallerException : invalid xml character(0x0) found in xml ".
    Can I put some filter before creating xml file using JAXB so that it wont allow an invalid character to be written into xml file ?
    Please provide some code ,

    Hi Xavi,
    " suppose we have to do it before to take the file, or another way could be to take the file without content conversion, and with a java mapping delete the nulls and create the message we send to R/3.
    What do you think about this?"
    Ans)
    Yes that's correct. You can follow this blog http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4018
    where without FCC the mapping code directly creates the target XML.  you can add code to replace all null characters as example shown below
    String line = bin.readLine();
    String s="";
    for(int i=0;i<line.length();++i)
         if(line.charAt(i)!=)0X00)
            s=s+line.charAt(i);
    line=s;
    Any source interface is fine in interface mapping and no need to use FCC. Rest all setrtings will be normal as per the blog.
    Regards
    Anupam

  • Invalid XML charector

    Hi,
    Could any one please tell me how to parse the invalid charectors which are less than &#32. The encoding style i am using is UTF-8 and its not possible for me to change the style to iso-8859-1.
    The exception i am getting is :
    org.apache.xml.utils.WrappedRuntimeException: Can not load requested doc: Character reference "&#2" is an invalid XML character.
    Scenario
    My application generates a report by picking data from the database and displays in the format( html,xml,csv).
    But while generating the report the the xerces is unable to parse the data and resulting the above error.
    I appreciate if any one could help me.
    Regards,
    Viswanath.

    If you put an illegal character into an XML document it will not be parseable. So, it's your choice. Put the illegal character in there and have an unusable document. Or don't put it in there and have a usable document. I know which I would prefer but it's up to you.
    If you're asking how you should represent illegal characters, should you decide not to put them into the document as is, that's up to you too. You can't just put in the standard XML encoding for the illegal character, either, because that's the same as putting in the character.
    I already mentioned one possibility. If you don't like that and want to do something else, that's fine too. Just remember that you have to represent all of your data as a sequence of legal XML characters. And the receiver of the document needs to know the rules so that it can decode the data back to the binary form.

  • Invalid XML tables

    I have an invalid xml table. It was created basing on xml schema and types generated. Then the schema was dropped with all its types.
    I try to drop the invalid table and it says:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-04063: table "SCOTT.1" has errors
    what should I do? Generally, I can reregister the schema with the exact generated types. But is there any other way to delete this table?
    By the way, I use 10g server.
    Thank you for any answer.

    Could it be that your table name is "1 " (with 1 space extra) or even more spaces? (indeed, extra spaces!). Try checking the name of the table by replacing the spaces with a different character via SQL. Did the database give an error number and if so which one?
    It is possible to create a table like
    SQL> create table "1 "
    2 (xmldata xmltype)
    3 ;
    Table created.
    SQL> drop table "1"
    2 ;
    drop table "1"
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> drop table "1 "
    2 ;
    Table dropped.

  • "&# 19" is an invalid XML character.

    HI!
    I have created a query template which runs an Oracle stored procedure:
    CALL Stored_Proc_Name('[Param.1]','[Param.2]',:x).
    When I test it and show result in "text/html" it works well.
    Now, I have added an "SQL Query action bloc" in a BLS which referred to that last query template. When I'm trying to generate sample XML of the action bloc, I’m getting the following error message:
    "There was an error generating sample XML.
    Error message: Character reference
    "& #19" is an invalid XML character."
    I did a search in my result but I didn't find any weird character.
    Also, I did try to output the result of my query template in "text/xml" format. I was able to see some results but i was getting a JAVA error on the page: Invalid character.
    Any idea of what this could be and to resolve it without encoding database content?

    Marie-Helene,
    It may very well be that a non-unicode (unfriendly xml character) symbol ended up in the db through an import of some sort or a copy/paste.  If you can focus on the string fields like a comment field, etc. you may be able to filter your query a bit to see where or which record is not playing well with the query template.
    It is possible that sending the saved query template results to an iGrid may work since xml is not in the mix.  If that works and you can narrow it down you may be able to see the strange character(s) visibly in the applet. 
    Another thing to try would be to run a query in a format such as:  http://<servername>:<port>/Lighthammer/Illuminator?QueryTemplate=Folder/NameQuery&Content-Type=raw/binary
    The raw binary feed is the same used by the applets, but when the browser gets the results it won't know what to do with the mime-type and IE will give you the Open/Save As dialog.  If you save it to disk you may be able to find the character and position by opening the saved file with a text editor.
    Best Regards,
    Jeremy Good

  • Unable to generate output due to huge xml generated

    Hello All,
    I am working on etext templates for generating EFT payments.
    When the payments are below 100 then the output is fine. But when it is crossing 100 payments then it is not producing any output.
    This is a standard rtf which I have modified and added some xpath conditions in the OutboundPayment table. I think because of xpath conditions the xml structure is modified internally and the xml generated is very huge.
    When I have used the original rtf without adding any conditions the output is produced for any number of payments.
    Can any one provide some help on this.

    sorry posted in wrong forum

Maybe you are looking for

  • Freezing, mouse moves, fine in safe mode... help!

    macbook stopped working this morning. everything froze- i get spinning circle of death, but cursor moves. running maveriks. ran all disk permissions, repaired disk etc and nothing seems to work- did this after booting to recovery- multiple times. boo

  • Trouble with Solaris 10 install on SunBlade 100 using Media CDs from Sun

    Hello World, My SunBlade 100 was not reading various burned Solaris 10 media, so I purchased the media kit from Sun. The installation is successful up until the point where it asks for CD2. I didn't even hear the drive spin when I clicked "Next" afte

  • Coloring placed images in Acrobat

    Greetings, Is there a way to colorize placed images (raster or vector, any format) in Acrobat? Thanks

  • Physical standby on 9.2 failover fails

    Hello, I have setup physical standby database and it seems to be transferring data correctly. I tested it also be going into read only mode and querying for changes. My problem is attempting to do a failover. I simply disconnect the primary to simula

  • Can my Acer laptop use Time Machine wi-fi?

    Can my Acer laptop use Time Machine wi-fi? Is there some Apple proprietary software that prevents me from accessing the security enabled wireless network?