Error serializing XML document.

We are trying to serialize XML document using Oracle XML Parser (9.2.0.5.0).
Here is the code used for serialization
public static void write(Document doc, File resultFile) {
try {
// Create a TransformerFactory
TransformerFactory transformerFactory = TransformerFactory.newInstance();
// Create a new Transformer for Identity Transformation
Transformer transformer = transformerFactory.newTransformer();
// Make passed document the DOM source
DOMSource source = new DOMSource(doc);
// Make result file the Stream Result
StreamResult result = new StreamResult(new FileOutputStream(resultFile));
// Write the document by means of Identity Transformation
transformer.transform(source, result);
} catch (Exception exc) {
exc.printStackTrace();
Document to be serialized
test.xml
<?xml version="1.0"?>
<!DOCTYPE test SYSTEM "test.dtd">
<!-- This is a comment -->
<Test>
<TestElement>Test Data</TestElement>
</Test>
test.dtd
<!-- DTD -->
<!ELEMENT Test (TestElement)>
<!ELEMENT TestElement (#PCDATA)>
The serialized document looked like
<?xml version = '1.0'?>
<?#comment This is a comment ?><Test>
<TestElement>Test Data</TestElement>
</Test>
First of all the DOCTYPE declaration was not present in the serialized document.
Secondly the comments appeared in a wrong way, which even made it an invalid XML document.
How do we get this to work?
Thanks
Sagar

On 9.2.0.3.0 you can try dbms_xdb.deleteResource(Path,4)

Similar Messages

  • SSRS Reports getting error in XML document (1, 6110).

    Hi,
    SCCM 2012 R2  Query reports opening error it shows below errors few reports only open properly.
    Stack Trace:
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID)
       at Microsoft.Reporting.WinForms.ServerReport.EnsureExecutionSession()
       at Microsoft.Reporting.WinForms.ServerReport.SetParameters(IEnumerable`1 parameters)
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ReportViewerWindowsForms.SetParameterValues_DoWork(Object sender, DoWorkEventArgs e)
    System.InvalidOperationException
    There is an error in XML document (1, 6648).
    Stack Trace:
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID)
       at Microsoft.Reporting.WinForms.ServerReport.EnsureExecutionSession()
       at Microsoft.Reporting.WinForms.ServerReport.SetParameters(IEnumerable`1 parameters)
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ReportViewerWindowsForms.SetParameterValues_DoWork(Object sender, DoWorkEventArgs e)
    System.Xml.XmlException
    '', hexadecimal value 0x1F, is an invalid character. Line 1, position 6648.
    Stack Trace:
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
       at Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.LoadReport(String Report, String HistoryID)
       at Microsoft.Reporting.WinForms.ServerReport.EnsureExecutionSession()
       at Microsoft.Reporting.WinForms.ServerReport.SetParameters(IEnumerable`1 parameters)
       at Microsoft.ConfigurationManagement.AdminConsole.SrsReporting.ReportViewerWindowsForms.SetParameterValues_DoWork(Object sender, DoWorkEventArgs e)
    Kiran

    This has already been discussed and solved, please use the search funtion:
    http://social.technet.microsoft.com/Forums/en-US/home?category=systemcenter2012configurationmanager&sort=relevancedesc&brandIgnore=True&searchTerm=There+is+an+error+in+XML+document+
    Torsten Meringer | http://www.mssccmfaq.de

  • Error:SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Server was unable to read request. --- There is an error in XML document (1, 447). --- Input string was not in a correct format.

    Hi All,
        We have a scenario of FTP-->PI---> Webservice.  While triggering the data in the FTP, it is failing in the PI with the below error
    SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Server was unable to read request. ---> There is an error in XML document (1, 447). ---> Input string was not in a correct format.
    Can you please help?

    Hi Raja- It seems to be a data quality issue.
    Check for the value @ 1447 position in the xml message that you are trying to send to web service..
    may be a date filed/decimal value which is not in expected format.

  • SAP B1 Studio 9.7 - Error : There is an error in XML document (0, 0)

    Hi Friends,
    I am using SAP B1 Studio PL-9.7 for form designing. 
    But now a days i could not open this B1 Studio because of this error :
                   "System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.XmlException: Root element is missing."
    When open this SAP B1 Studio, it shows one dialog box with the above error. I attached the dialog box image with this.  Please help me..
    Advance Thanks,
    Indra.

    Hello Christian,
     i  know this reply is really late ;) I am actually the author of the blog post mentioned by @AnnaWY, the post she mentioned is in regards of a situation 'where everything' is how it should be. Basically, (i think) sometime administrator, or the
    person who implements ITSM webservices makes an error, hence this script will not run. You will end up with that issue mentioned, in order to fix it, either you should contact the person who is responsible for that service, OR rewrite the wsdl for it yourself.
    It might be a bit problematic, but, it is for sure doable, as in my latest blog post about this issue. 
    I am writing it here, because i also saw this page, while googling for explanation, i guess there are more people who are looking for this so here is the link to the explanation:
    http://wp.me/pAXaY-ht
    I hope that helps !
    Regards,
    Greg

  • SRSS - Error in XML document

    Running Report Count all instances of software registered in add remove programs. Run fine in the "old" native SCCM
    On Reporting services the report also displays correctly but when drilling down to the linked report "Computers with specific software registered in Add Remove Programs" get the error below
    Seems to be for any item in this report - has anyone else seen this ?
    There is an error in XML document (1, 478919).
    '', hexadecimal value 0x02, is an invalid character. Line 1, position 478919.
    Ian Burnell, London (UK)

    Hello Grath,
    I run the following command in sql & find some updates:-
    Select distinct
    CHARINDEX(cast(0x28 as varchar(1)),DisplayName0),
    DisplayName0
    from
    dbo.v_Add_Remove_Programs
    Where
    CHARINDEX(cast(0x28 as varchar(1)),DisplayName0) > 0
    Screenshot:-
    Mentioned above updates makes problem hows to resolve this.
    Please suggest the solution on this.
    Thanks Rahul$

  • Creating new analysis gives "Error loading XML Document from ..."

    Trying to create analysis and getting "Error loading XML Document from saw.dll/answers/answersproperties.xml?fmapId=S1clug.
    The response given was:" after choosing subject area. Analysis editor is opened but Subject Areas is empty and can't do anything.
    The problem is on Mozilla 12 (16.0.2, 17.0.1) and IE 8. Chrome works fine.
    My system is Win 7, BI 11.1.1.6.0 is on Oracle Linux (and by the way Mozilla from Linux system works fine)
    What could be the reason of this?
    Edited by: 898973 on 4/12/2012 15:11

    Reinstalling Mozilla with "Remove personal data" option checked resolved the problem.

  • Error in webservice call | Error in XML Document(1,358)

    Hi all,
    We currently have a web service developed in Java, which we're calling from
    a dot net coded windows form. this web service is returning an object of type
    abc (say). Now, when we try and get a response from java server on the form,
    i'm getting the following error:
    There is an error in XML document (1, 358)
    Does this have something to do with a java serialised object not being able
    to get deserialised in dot net? Or is it something else?
    Also, I have a web reference that has been created on this java web service.
    This I believe means that the object that we're trying to get on the dot net
    client would be the java object that is being sent from the web service.
    Point to be noted is the fact that this web service was working absolutely fine till about 2 days ago.
    Any pointers are gladly appreciated.
    Cheers!
    Nick

    Sorry for not mentioning the product versions:
    The bpel process was build and deployed with Jdeveloper Studio edition version 10.1.3.1.0.3984 on a Bpel server/Application Server with version 10.1.3.1 (NT).

  • Error loading XML Document from /analytics/saw.dll/common/privileges.xml

    I tested my procedure for upgrading from OBI 11.1.1.5 to 11.1.1.6 which was successful. I had to rollback to OBI 11.1.1.5 using my database backup and VM snapshot due to project requirements.
    The OBI application successfully comes up but users who login just get "Error loading XML Document from /analytics/saw.dll/common/privileges.xml?fmapID=KqIJCw. The response given was: ". They can't close this message box so are unable to do anything.
    How can I fix this?

    Hi All,
    You can face this issue with other versions of OBIEE 11.*
    Problem cab be solved as follows:
    Go to http://localhost:7001/em  > coreapplication > Capacity Management > Scalibility >
    1. Lock and edit
    2 .increase number of presentation services to 2
    3. restart opmn component.
    Go to coreapplication > Availibility > processes
    1 .please note that in deployment > catalog > change path of catalog field from $coreapplication to path where your catalog resides.
    2. Take down your primary instance.
    3. As your secondary is up, it will grant you to browse you through catalog and dashboards.
    If you want to run primary instance of presentation services
    Go to path \Middleware\instances\instance1\bifoundation\OracleBIPresentationServicesComponent\coreapplication_obips2
    except catalog and catalog manager > Copy all other files to coreapplication_obips1
    restart opmn component > problem solved.!!!
    Regards,
    Akshay S.
    please like if you find it helpful

  • -error in XML document- when migrating from BPEL 10.1.3.3 to 10.1.3.4

    Hi,
    I've just been handed as set of BPEL processes which were developed in 10.1.3.3 and I'm working on migrating them to 10.1.3.4.
    Migration of most processes was straight forward, however, there is one process (SendMessage) that accepts an XML document as its input. The message payload is successfully sent in the older version, however, in version 10.1.3.4, I keep on getting the following error.
    Server was unable to read request. ---> There is an error in XML document (195, 99). ---> Input string was not in a correct format.
    The line number is the end line number of the xml document message.
    I've checked both versions and in 10.1.3.3 the ValidateXML option is set to false, whereas in 10.1.3.4 its 'none', which is equivalent to false.
    Are there any other settings in 10.1.3.4 that could be causing this error? Has anyone else come across this issue when migrating upgwards from 10.1.3.3?
    I would greatly appreciate any suggestions.
    Kind regards,
    Shiraz

    I had recently done the same migration. One of the issues I had faced was while specifying the nillable elements I used to get an error if the namespace definition was in the header. The error was occuring while sending the message to AQ.
    I do not know if this will help. Also it would be useful if you could provide details of where the process is failing is it failing at the receive activty or later. What does the process do....
    Best of luck with the problem.

  • SAP B1 Studio - Error Opening: There is an error in XML document (0, 0)

    Hello everyone!
    Now try to open the SAP Business One Studio Suite and I get the following error:
    "System.InvalidOperationException:. There is an error in XML document (0, 0) ---> System.Xml.XmlException: Root element is missing."
    Reinstall the application and nothing, continuing the error, the client SAP B1, Visual Studio 2010 and B1DE work correctly.
    As I can fix this?
    Thank you for your help!

    Thanks,
    I have tested on SCORM Cloud and it is working... The SCORM content has been published with 2004 3rd edition.
    We are making use of the Icodeon SCORM player (integrate with Signify LMS), do you perhaps think it could be something on the SCORM player then?

  • Get error (There is an error in XML document (3, 4)) when consuming web service HelpDesk_QueryList_Service with New-WebServiceProxy

    Dear all,
    I'm using the powershell cmdlt New-WebServiceProxy to query ITSM incidents. I'm able to get the WSDL definition ..
    $uri='http://pitsm/arsys/WSDL/public/pitsmapp/HPD_IncidentInterface_WS'
    $myitsm=New-WebServiceProxy -Uri $uri -Namespace ITSM -Verbose true
    $auth= New-Object ITSM.AuthenticationInfo
    $cred=get-credential
    $auth.username=$cred.username
    $auth.password= [System.Runtime.InteropServices.marshal]::PtrToStringAuto([System.Runtime.InteropServices.marshal]::SecureStringToBSTR($cred.password))
    $auth.authentication="Domain Authentication"
    $myitsm.AuthenticationInfoValue=$auth
    $myitsm.RequestEncoding =  [System.Text.Encoding]::UTF8
    $tid="INC000002237910"
    $criteria="'Incident Number' = ""$tid"""
    When i'm consuming now the web service i get back an error messages:
    $answer=$myitsm.HelpDesk_QueryList_Service($criteria,0,100)
    Exception calling "HelpDesk_QueryList_Service" with "3" argument(s): "There is an error in XML document (3, 4)."
    At line:1 char:1
    + $answer=$myitsm.HelpDesk_QueryList_Service($criteria,0,100)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : InvalidOperationException
    Has anybody an idea what could be wrong?
    Any idea how to debug the commandlet New-WebServiceProxy?
    Best Regards
    Chris

    Hello Christian,
     i  know this reply is really late ;) I am actually the author of the blog post mentioned by @AnnaWY, the post she mentioned is in regards of a situation 'where everything' is how it should be. Basically, (i think) sometime administrator, or the
    person who implements ITSM webservices makes an error, hence this script will not run. You will end up with that issue mentioned, in order to fix it, either you should contact the person who is responsible for that service, OR rewrite the wsdl for it yourself.
    It might be a bit problematic, but, it is for sure doable, as in my latest blog post about this issue. 
    I am writing it here, because i also saw this page, while googling for explanation, i guess there are more people who are looking for this so here is the link to the explanation:
    http://wp.me/pAXaY-ht
    I hope that helps !
    Regards,
    Greg

  • There is an error in XML document - TimeStamp

    Hi All,
    Hope you can help. Captivate has been working great so far on our LMS. But since moving to Captivate 7 when submitting we get the below problem,
    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>System.Web.Service s.Protocols.SoapException: Server was unable to read request. ---&gt; System.InvalidOperationException: There is an error in XML document (2, 1250). ---&gt; System.FormatException: The string '2013-07-24T16:30:41.0+02' is not a valid AllXsd value.
       at System.Xml.Schema.XsdDateTime..ctor(String text, XsdDateTimeFlags kinds)
       at System.Xml.XmlConvert.ToDateTime(String s, XmlDateTimeSerializationMode dateTimeOption)
       at System.Xml.Serialization.XmlCustomFormatter.ToDateTime(String value)
       at System.Xml.Serialization.XmlSerializationReader.ToDateTime(String value)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read19_interactionT ype(Boolean isNullable, Boolean checkType)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read20_interactions Type(Boolean isNullable, Boolean checkType)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read32_cocdType(Boo lean isNullable, Boolean checkType)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read34_RteDataModel Type(Boolean isNullable, Boolean checkType)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read36_Commit(Boole an isNullable, Boolean checkType)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read41_Commit()
       at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer4.Deserialize(XmlSer ializationReader reader)
       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
    --- End of inner exception stack trace ---
       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
       at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
    --- End of inner exception stack trace ---
       at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
       at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>
    Is this a problem possibly between the editions of SCORM or is it something in the Captivate product? Perhaps the xml parser version?

    Thanks,
    I have tested on SCORM Cloud and it is working... The SCORM content has been published with 2004 3rd edition.
    We are making use of the Icodeon SCORM player (integrate with Signify LMS), do you perhaps think it could be something on the SCORM player then?

  • There is an error in XML document (1, 3616).

    Hi all,
    i got the following error when i m trying to update item master using B1WS.
    There is an error in XML document (1, 3616). any solution it's very urgent
    Thanks & Regards
    B.Lakshmi narayanan

    Hi Lakshmi,
    Just like the error is stating... The structure of the xml you are sending thru DIS is incorrect.
    Export it to a file and have a look at it...
    Regards,
    Eric

  • Serializing XML Documents(not Java Serialization)

    Hi,
    Iam looking for a class that can serialize the XML documents.
    Heres the problem in detail:
    - I need to create an XML String from scratch taking data from a database.
    - I created the XML Document adding the childs and attributes.
    - I need an XML string from the document. Iam not exactly sure how to do this. But Apache Xerces package provides an XMLSerializer class where we can convert the document into a string.
    Is there any functionality provided. If so where can i find it.
    Thanks,
    -Rao

    Not sure if this is a bug or not (filing one just in case it is) but the following program demonstrates that with 2.0.2.9 the internal subset is serialized correctly if the document was parsed with validationMode set to true. If set to false only the entities show up in the internal subset.
    package xmlbugs;
    import java.io.*;
    import org.w3c.dom.*;
    import oracle.xml.parser.v2.*;
    public class TestSerializeLocalSubset {
    private static final String xml =
    "<?xml version='1.0' encoding='UTF-8'?>"+
    "<!DOCTYPE bar ["+
    "<!ENTITY bar 'baz'>"+
    "<!ELEMENT foo EMPTY >"+
    "<!ELEMENT bar (foo) >"+
    "]>"+
    "<bar><foo/></bar>";
    public static void main(String[] a_ ) throws Exception {
    System.out.println("Test with parser in validation mode = false");
    DOMParser d = new DOMParser();
    d.setPreserveWhitespace(false);
    d.setValidationMode(false);
    d.parse( new StringReader(xml));
    Document x = d.getDocument();
    XMLDocument xx = (XMLDocument) x;
    xx.print(System.out);
    System.out.println("Test with parser in validation mode = true");
    DOMParser d2 = new DOMParser();
    d2.setPreserveWhitespace(false);
    d2.setValidationMode(true);
    d2.parse( new StringReader(xml));
    x = d2.getDocument();
    xx = (XMLDocument) x;
    xx.print(System.out);
    }

  • Serializing XML documents throws AIOOBE

    I have a bunch of XMLDocuments that are generated from Forms modules with the Forms2XML.dumpModule but when I try to serialize the collection through and ObjectOutputStream, I end up with a
    java.lang.ArrayIndexOutOfBoundsException: 16388
         at oracle.xml.comp.CXMLStream.writeUTF(CXMLStream.java:638)
         at oracle.xml.parser.v2.XMLAttr.writeExternal(XMLAttr.java:834)
         at oracle.xml.parser.v2.XMLElement.writeExternal(XMLElement.java:2333)
         at oracle.xml.parser.v2.XMLElement.writeExternal(XMLElement.java:2355)
         at oracle.xml.parser.v2.XMLElement.writeExternal(XMLElement.java:2355)
         at oracle.xml.parser.v2.XMLDocument.writeExternal(XMLDocument.java:2746)
         at oracle.xml.parser.v2.XMLDocument.writeExternal(XMLDocument.java:2678)
    My guess is that some stuff nested in XMLDocument implement the java.io.Externalizable interface and tries to do stuff itself and fails.
    When I look at the generated XML, it shows that the encoding is "UTF-8" but there are unencoded ISO-8859-1 chars in the doc so it could be what the writeUTF is complaing about? Is there some way of mangling the document to the correct encoding or other applicable magic?

    Hello,
    Did you managed to solve this problem ? I'm getting the same error if i try to load an xml in a queue using oracle OJMS.
    Replacing the xmlparserv2.jar by the one from oc4j v 10.1.3 solved the problem, but this is not supported in a production environmen.
    grtz,
    Chris.

Maybe you are looking for

  • What is import statement for ?

    Hi all, Sorry for asking a silly question. Since it is a new to java forum I am asking this. What is happening when an import statement is triggered at compile time and at runtime. What is the difference/advantages/disadvantages between importing an

  • For Loop with parameter in application process

    Hello, I am working on a project for school and a loop in an application process is giving me a headache. I have an application from which I make an ajax call to an "on-demand" process. Here's a short version of the process: declare valuesList varcha

  • Display Issues in Descriptive Flexfield(DFF)

    Hi, I have two issues in using a DFF seeded by Oracle HRMS(DFF Title: Personal Address Information and DFF name: Address Structure) in my custom OA Page. Issue 1 When the custom OA page is rendered automatically the first record in the DFF table is s

  • Nokia C7 - POWER saving SCHEDULE for night period

    Hello NOKIA! I have a suggestion  for  "the biggest (and most awaited!) update ".... PR  2.0  for  C7  &  N8. We know that all phones with touch screen are big consumers of power and the battery life greatly decreases. I do not use the phone at night

  • On change statement problem

    Hi All, I am craeting program for automatic sending mail..... in that program i have write body part with header and line item..... present my output is like below: Controling Area | Cost center | Company Code 5000                | 159040        | 04