Document not well formed

Hi-
one of the things i liked about java is it had a stack trace
that went to the moon and it helped
you find where your error is.
if i run my code in PHP IDE it is well formed enough and
spits out the right result.
If i upload it to my webhost set to shared environment it
keeps coming up document not well formed.
I dont really understand what code causes this message as
there is no line number.
I tried to make sure my xml started with the xml tag and had
a root and closing tags.
Does flex 3 offer any more insight with diagnostic messages
as to where the problems may
surface from? the message seems to indicate "url loader on
complete" .
where would you look if you got a url loader on complete?
i am really stuck. it is frustrating to see it work in php
and then not on the web host :-)
(error msg. below)
thanks for any assistance,
jim
[RPC Fault faultString="Error #1088: The markup in the
document following the root element must be well-formed."
faultCode="Client.CouldNotDecode" faultDetail="null"]
at mx.rpc.http::HTTPService/
http://www.adobe.com/2006/flex/mx/internal::processResult()[C:\dev\enterprise_bali\framewo rks\mx\rpc\http\HTTPService.as:856
at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::resultHandler()[C:\dev\enterprise_bali\framewo rks\mx\rpc\AbstractInvoker.as:165
at
mx.rpc::Responder/result()[C:\dev\enterprise_bali\frameworks\mx\rpc\Responder.as:48]
at
mx.rpc::AsyncRequest/acknowledge()[C:\dev\enterprise_bali\frameworks\mx\rpc\AsyncRequest. as:82]
at
DirectHTTPChannel.as$139::DirectHTTPMessageResponder/completeHandler()[C:\dev\enterprise_ bali\frameworks\mx\messaging\channels\DirectHTTPChannel.as:359]
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()

Hi-
i think i found out why i couldnt get my code to work. the
local machine had different things enabled that werent
enabled on the web host for PHP. i asked the admin to enable
PHP 5 includes the XSL extension by default and can be
enabled by adding the argument --with-xsl[=DIR].
it looks suspicious.
thanks,
jim

Similar Messages

  • Xjc throwing exception that "document not well formed"

    I have the following DTD file given in the sample code saved as item.dtd
    <?xml version='1.0' encoding='utf-8'?>
    <!-- Simple DTD -->
    <!ELEMENT item_list (item_info*)>
    <!ELEMENT item_info (name, price)>
    <!ELEMENT name (#PCDATA)>
    <!ELEMENT price (#PCDATA)>
    and the following xjs file as given in the sample code
    saved as item.xjs
    <xml-java-binding-schema>
    <element name="item_list" type="class" root="true"/>
    <element name="item_info" type="class"/>
    </xml-java-binding-schema>
    now from command prompt when I run the following command, it throws the following error.
    c:\Some-folder\ xjc item.dtd item.xjs
    the EXCEPTION thrown is :
    The markup in the document preceding the root element must be well-formed. line 4 of item.dtd
    The FULL TRACE is(if anybody is interested to see).. PLEASE HELP ME OUT.
    Thanks
    Gagan
    TRACE STARTS HERE:
    parsing a schema...
    The markup in the document preceding the root element must be well-formed.
    line 4 of item.dtd
    Exception in thread "main" ::file:///C:/RBML/xml-java/item.dtd:file:///C:/RBML/x
    ml-java/item.dtd:file:///C:/RBML/xml-java/item.dtd:4:3:The markup in the document preceding the root element must be well-formed.

    NO i dont think so..
    as you could see the code pasted in the first instance. the only diffrence is that you are using double quotes.(I tried that as well)
    I hope you are referring to item.dtd file not item.xjs file
    Thanks
    Gagan

  • Xjc ,dtd, xjs giving problem "document not well formed"

    I have started the thread again.
    Anyway.
    I have an item.dtd file (same as in sample tutorial).. I have reduced some components to simplify..when it was not working
    item.dtd file:
    <!ELEMENT ITEM (NAME)>
    <!ELEMENT NAME (#PCDATA)>
    item.xjs file:
    <xml-java-binding-schema>
    <element name="ITEM" type="class" root="true"/>
    </xml-java-binding-schema>
    when i run from command prompt:
    C:\RBML\xjc item.dtd item.xjs
    It throws up an error
    The markup in the document preceding the root element must be well-formed. line 1 of item.dtd
    I am not able to understand the error..how it can be rectified.
    PLEASE HELP..!
    I have tried adding the following line to item.dtd but doesnot work
    <?xml version="1.0" encoding ="utf-8"?>
    I had also tried removing redundant spaces and blank lines.
    PLEASE HELP
    Thanks
    Gagan

    I'm have done the same for schemas.But giving the error as
    "[ERROR] Unexpected <xml-java-binding-schema> appears at line 1 column 26
    line 1 of item.xjs"
    my xjs file is
    "<xml-java-binding-schema>
    <element name="item_list" type="class" root="true"/>
    <element name="item_info" type="class"/>
    </xml-java-binding-schema>"
    andmy schema is
    "<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="item_list">
    <xsd:complexType>
         <xsd:sequence>
              <xsd:element name="item_info" maxOccurs="unbounded">
                   <xsd:complexType>
                        <xsd:sequence>
                             <xsd:element name="name" type="xsd:string"/>
                             <xsd:element name="price" type="xsd:decimal"/>
                        </xsd:sequence>
                   </xsd:complexType>
         </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>".
    Pls help me

  • XML from CF not well-formed?

    I have been working through the Training from the Source book
    on Flex2 (Trapper, Boles, Talbot, etc.). In Lesson 17, it deals
    with accessing server-side objects.
    One piece of code accesses a CF template, which brings in an
    XML file:
    <mx:HTTPService id="prodByCatRPC"
    url="
    http://localhost/flexGrocer/xml/categorizedProducts.cfm"
    result="prodByCategoryHandler(event)"
    resultFormat="e4x" />
    The CF plate from the book's file has the following:
    <cfheader name="Expires" value="#now()#" />
    <cfxml variable="xProducts">
    <cfinclude template="categorizedProducts.xml">
    </cfxml>
    <cfset xmlObject=ToString(xProducts)>
    <cfcontent type="text/xml" />
    <cfoutput>#variables.xmlObject#</cfoutput>
    When run the Flex file, I get a run-time message which seems
    to indicate that the XML is not well-formed. (Here is a bit of the
    message; not sure I'm understanding it!):
    [RPC Fault faultString="Error #1088: The markup in the
    document following the root element must be well-formed."
    faultCode="Client.CouldNotDecode" faultDetail="null"]
    I am ASSUMING that the CF page is not returning the xml as
    desired, because if I simply change the flex http service call to
    the xml file that the CF page is including, the flex app runs as
    expected and without errors:
    url="
    http://localhost/flexGrocer/xml/categorizedProducts.xml"
    (something in the posting mech is making the above url
    statement messed up, but you can probably tell what I mean)
    I am a CF developer and although haven't used the book's
    exact method to get the cf generated xml, I have done so
    successfully for Spry and other things.
    I tried some ot the things I had to do to get the CF
    generated xml to work in Spry with this flex, but didn't help.
    Tried adding a reset='true" with the cfcontent tag; tried making
    the cfcontent wrap the output; added cfprocessing tags to
    suppresswhitespace.
    Appreciate any thoughts/help on how to solve this. Also,
    whether others agree that the problem is with the generated xml
    rather than something else.
    Thanks
    Keith

    I don't remember the exact context when I first posted this
    question and answered it; but, if one doesn't want to change
    overall settings for debugging in cf admin., I *think* you can
    ajust for a specific area using cfsetting and/or
    cfprocessingdirective. There's a number of attributes and
    combinations there that I think can take care of the problem. I
    forget for sure, but may want to try that, especially on a
    development box where you might generally want debugging to be on.
    Also, if using cfcs in any part of what you generate, they
    can produce whitespace. To solve (or minimize), make sure that
    output attribute in the component is false and that output in
    function is false (unless directly outputting within the function.
    Seems like CF and whitespace is an ongoing item to try to
    manage.
    Keith

  • File not well formed: Process instruction name (may not be 'xml') expected

    I am a WBI developer whose end result is to produce one XML file. This file will receive a number of events that will constantly append to XML file. Each appendage will contain same structure but diff data than one before. Also I have created a WBI business object to mirror the XML structure.
    However, below is my XML in a Not well formed state. My error happens at first appendage ( see second tag of ><?xml version='1.0' encoding='utf-8'?>)
    My question: Can I actually produce a correct XML file? if so how do I do this, is it a change needed in my Busines Object? And if I cannot then what are my other options.
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE BATCH_AUTO>
    <BATCH_AUTO><POLICY><POL_TRANCODE>CHKS</POL_TRANCODE><POL_EXTRACTDTE>20050602</POL_EXTRACTDTE><POL_POLICYNO>PAA-123456789</POL_POLICYNO><POL_EFFDATE>20050101</POL_EFFDATE><POL_DUEDATE>20051201</POL_DUEDATE><POL_TOTALPREMIUM>1</POL_TOTALPREMIUM><POL_ACCTBALANCE>2.00</POL_ACCTBALANCE><POL_MAILNAME1>John Doe</POL_MAILNAME1><POL_MAILNAME2>Jane Doe2</POL_MAILNAME2><POL_MAILNAME3>Mark Doe3</POL_MAILNAME3><POL_MAILADDR1>1234567891 W1 MAIN St. A ST A WA APTAPTAPTAPT 12345678 APTAPTAPTAPT 12345678</POL_MAILADDR1><POL_CANCELDATE>20050901</POL_CANCELDATE><POL_CANCELREASON>REASON</POL_CANCELREASON><POL_SUBTOTAL>7.00</POL_SUBTOTAL><POL_TOTALFEE>1</POL_TOTALFEE><POL_TOTALADJS>4.00</POL_TOTALADJS><POL_CHECKDATE>020050525</POL_CHECKDATE><POL_CHECKNO>000001</POL_CHECKNO><POL_CHKEXPLANATION>Cancelled</POL_CHKEXPLANATION><POL_CHECKAMOUNT>5</POL_CHECKAMOUNT><POL_BANKACCTNO>8765015692</POL_BANKACCTNO><POL_BANKROUTNO>719232845</POL_BANKROUTNO><POL_TOTAMTPAID>1</POL_TOTAMTPAID></POLICY></BATCH_AUTO><?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE BATCH_AUTO>
    <BATCH_AUTO><POLICY><POL_TRANCODE>CHKS</POL_TRANCODE><POL_EXTRACTDTE>20050602</POL_EXTRACTDTE><POL_POLICYNO>PAA-123456789</POL_POLICYNO><POL_EFFDATE>20050101</POL_EFFDATE><POL_DUEDATE>20051201</POL_DUEDATE><POL_TOTALPREMIUM>1</POL_TOTALPREMIUM><POL_ACCTBALANCE>2.00</POL_ACCTBALANCE><POL_MAILNAME1>John Doe</POL_MAILNAME1><POL_MAILNAME2>Jane Doe2</POL_MAILNAME2><POL_MAILNAME3>Mark Doe3</POL_MAILNAME3><POL_MAILADDR1>1234567891 W1 MAIN St. A ST A WA APTAPTAPTAPT 12345678 APTAPTAPTAPT 12345678</POL_MAILADDR1><POL_CANCELDATE>20050901</POL_CANCELDATE><POL_CANCELREASON>REASON</POL_CANCELREASON><POL_SUBTOTAL>7.00</POL_SUBTOTAL><POL_TOTALFEE>1</POL_TOTALFEE><POL_TOTALADJS>4.00</POL_TOTALADJS><POL_CHECKDATE>020050525</POL_CHECKDATE><POL_CHECKNO>000001</POL_CHECKNO><POL_CHKEXPLANATION>Cancelled</POL_CHKEXPLANATION><POL_CHECKAMOUNT>5</POL_CHECKAMOUNT><POL_BANKACCTNO>8765015692</POL_BANKACCTNO><POL_BANKROUTNO>719232845</POL_BANKROUTNO><POL_TOTAMTPAID>1</POL_TOTAMTPAID></POLICY></BATCH_AUTO>

    Hi,
    The <?xml version='1.0' encoding='utf-8'?>) xml declaration can occur only once and that too at the very top of the xml file before everything else. I think your best bet would be to strip the xml declaration and the doctype declaration before appending. You might want to check the API documentation of the API you are using to serialize the xml to see if it supports suppressing xml and doctype declarations.
    With apache xerces, you can do
    OutputFormat.setOmitXMLDeclaration(true);
    where OutputFormat dictates what underlying serialized is used to serialize the document based on the specified method.
    Hope this helps.
    Cheers,
    vidyut

  • Not Well Formed.

    Hello,
    Here's my workflow between ID and IC.
    1. Export a selected frame in InDesign to InCopy.
    2. Open the indd file in InCopy.
    3. Check out the exported content and edit it.
    4. Save the document and check the edited content back in.
    5. Open the file (indd) in InDesign.
    6. Update the modified content (refresh)
    At this point, InDesign gives me the floowing notification: "Not Well Formed."
    That's it. It doesn't give any error codes. The bad thing is, it is not possible to bring the updated content back into InDesign, neither it's possible to edit the InDesign content. In order to edit the content in ID, I need to updated to document (since it was modified in IC). But because of the "Not Well Formed" message, it's not possible to neither updated nor edit the content.
    I've tried 3 different documents. One of them was a few hundred pages. The other is just a 1 page test document. Tried restarting, tried starting creating a test document from scratch. Keep getting the same message.
    Any idea? BTW, The document originally was a CS2 ID document. We recently upgraded from CS2 to CS4.
    Thanks.
    CS4
    WinXP Pro SP3

    Yes, I do have the latest patches.
    When I create a new document in ID CS4 and export that to InCopy CS4, that works fine. I only have problem with the converted ID CS2 documents.
    Our old ID CS2 document is about 180 pages and has a lot of paragraph styles. If I clear ALL paragraph styles from the CS2 document, so all copy is just plain text, then I can export and edit in InCopy CS4 just fine. Then I can bring the document back into ID CS4 and edit it further if needed.
    So it seems to me that there is a bug of some sort. If the ID CS2 document contains paragraph styles, it cannot be brought into the ID/IC CS4 workflow because the paragraph styles will flag this "Not well-formed" message.
    To verify this, I've created a simple document in ID CS2 and crreated a few paragraph styles in it. Opened the document in ID CS4, exported to IC CS4. Sure enough, I could not bring it back to ID CS4 no more because of the "Not well-formed" problem.
    Why would my OS has to do anything with it? It's a spanking new fast machine, with a brand new, fresh installation of CS4 products. I do have an older Mac G4 (currently running on OSX 10.4) which was part of the old workflow. The original ID CS2 document was created on the Mac. But it should not matter. The CS4 suite works on both platforms.
    It's gotta be a bug. Right before our 3 week deadline. That's great. I'm glad we threw out the money for a 4 workstation upgrade, since we didn't have IC for CS2. That was the whole point for the upgrade. To make life easier. Turns out, it's not.
    GRrrrrrrrrrrrrrrrrrrrrrrrrr...

  • Help! Flash error: 1088 (Markup in doucment not well-formed)

    I'm trying to use ASP.NET to retrieve data from the sql server, place in inside an xml and sends the xml to flash to display the data.
    However, I'm getting
    TypeError: Error #1088: The markup in the document following the root element must be well-formed.
    at news_fla::mainTimeline/loaded()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    This is my code:
    ASP.NET
    =======
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim adapter As SqlDataAdapter
            Dim ds As New DataSet
            Dim sql As String
            Dim con As New SqlConnection("data source = GN80000798-0\SQLEXPRESS2008; initial catalog = EL; integrated security = true")
            sql = "select * from news"
            Try
                con.Open()
                adapter = New SqlDataAdapter(sql, con)
                adapter.Fill(ds, "data")
                con.Close()
                Response.ContentType = "text/XML"
                Response.HeaderEncoding = Encoding.UTF8
                ds.WriteXml(Response.OutputStream, XmlWriteMode.WriteSchema)
                MsgBox("Done")
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try
        End Sub
    Flash
    ====
    import flash.xml.*;
    var newsrequest:URLRequest = new URLRequest("http://localhost:1179/DB/DB.aspx"); //ASP.NET development server
    var newsloader:URLLoader = new URLLoader();
    var newsxml:XML;
    var dvar:URLVariables = new URLVariables();
    dvar.dummy = "dummy";
    newsrequest.data = dvar;
    newsrequest.method = URLRequestMethod.POST;
    newsloader.load(newsrequest);
    newsloader.addEventListener(Event.COMPLETE, loaded);
    titlenews.autoSize = TextFieldAutoSize.LEFT;
    bodynews.autoSize = TextFieldAutoSize.LEFT;
    function loaded(event:Event){
    newsxml = new XML(event.target.data);
    newsxml.ignoreWhitespace = true;
    trace(newsxml);
    HOWEVER, if i replace the
    "ds.WriteXml(Response.OutputStream, XmlWriteMode.WriteSchema)"
    with
    "ds.WriteXml("C:\new.xml")
    it works. But i dont wan a .xml file residing in the server. so i hope that the .xml file would be cleared off as soon as the request is done.
    Did i do something wrong?
    PS: I don't know if i post this in the correct section but since it's related to AS3, thats why i post it here. sorry if i made a mistake.

    Please paste the following line as first statement in loaded function, also compare the output of the following line with expected output from ASP page.
    trace(event.target.data);
    The error is causing due to the fact that XML received is not well formed.
    I guess the problem is with write XML you are getting some additional tag elements and these are not wellformed. so flash is giving error.

  • How to format a not well formed xml into well formed

    Hi,
    Here's what I'm trying to do: I have a build a report based on query results. In the query result, one field is a CLOB (which contains XML. The XML contains two tags - "description" and "count"). I want to read (&parse) the XML and store the "description" and "count" in a hashmap. But when I try to parse it, I end up in an error. I'm currently  using XmlParse but I got an error "The markup following the root element should be well formed."  I immediately used IsXml() to find out if the XML I am reading is well formed.  And the answer is "NO".
    Could someone help me in converting it into a "well formed" one?
    (This is what I've tried: I appended "<?xml version="1.0" encoding="UTF-8"?>" to the XML I'm reading coz it was missing this.  I later used XmlFormat to convert the XML into a string format.  But IsXML tells me that even this is not well formed.)
    Thanks much for your help!

    XML encodes information is a specific way. Well-formedness determines whether or not a string is an XML document in the first place.
    However, as well-formedness can be broken by any arbitrary number of factors, it is in general impossible to automate the repair process to recover a well-formed XML document. You have to do it manually, using an XML or a text editor.

  • XML Custom Panels: Samples With Doc are Not Well Formed XML

    The custom panel samples in the XMP Custom Panels document (and the accompanying sample file) is not well formed XML (which means that CS3 can't be parsing the file as XML, which would explain how this error made it publication). In particular, the XML declaration is missing the closing "?".
    <br />
    <br />As published it is:
    <br />
    <br /><?xml version="1.0"?>
    <br />
    <br />It should be:
    <br />
    <br /><?xml version="1.0"?>
    <br />
    <br />Note the "?&gt;" rather than "&gt;".
    <br />
    <br />This is in addition to the DOCTYPE SYSTEM URL not resolving to an actual DTD declaration set (which would be:
    <br />
    <br />
    <br /> title CDATA #REQUIRED
    <br /> type NMTOKEN #REQUIRED
    <br />&gt;
    <br />
    <br />Cheers,
    <br />
    <br />Eliot

    You'll have to do something to prevent your logger from appending to old logs that have been closed. Sorry if that is not very helpful, but I'm not familiar with the logging features in SDK 1.4. For your interest, though, Log4J (which you can get from Apache) also features XML logging, and it solved that rather obvious problem thus:
    "The output of the XMLLayout consists of a series of log4j:event elements as defined in the log4j.dtd. It does not output a complete well-formed XML file. The output is designed to be included as an external entity in a separate file to form a correct XML file."
    In other words, you would have to wrap the output in an XML header and a root node to be able to use it, which is not difficult to do.

  • Not well-formed XML

    Hi guys,
    I need to parse an XML file which is not well formed.
    For example, the value of an element named 'topic' contains html tags which are not ended properly etc..
    e.g. <topic>Some text <BR></topic>
    Why do I need this? Because some idiots on their web site publish XML data (not well formed) which indeed is very valuable to me, and I want to use it. I tried contacting them on the "not-well-formed-XML" issue but haven't managed to get a reply yet. Hence I have been struggling with this using the SAX API and so on...
    I think there should be a way to ignore some elements' content when parsing the XML data but I haven't been able to do it...I am not experienced on SAX or DOM API's...
    For example if the problem is caused only by the BR tags then when I encounter it, either startTag or endTag, I should be able to ignore it. When I say "ignore", I mean "not change the state of the parser", or undo the last state change or whatever...Well at least I think I would write an XML parser like this if I were to do that...
    Any help is appreciated...

    Sorry to be the bearer of bad news.
    There is no such thing as an "XML file which is not
    well formed." There are files that look like they
    might be XML files but are not valid. I think that is
    what you have. One of the key differences between XML
    and HTML is that HTML has allowed sloppy habits to
    become routine. XML prohibits them from getting past
    the hurdle of validation.
    Dave PattersonI'm not sure about the comments that you have made about the validity and well-formedness about XML documents. As I said I'm not experienced in XML but as far as I understand, a document is called "valid" when it conforms to all the constraints imposed by a DTD. However, there is no DTD in my case and the XML document I have is not "well-formed" as defined below:
    A well-formed XML document is syntactically correct. It does not have any angle brackets that are not part of tags. (The entity references < and > are used to embed angle brackets in an XML document.) In addition, all tags have an ending tag or are themselves self-ending (<slide>..</slide> or <slide/>). In addition, in a well-formed document, all tags are fully nested. They never overlap, so this arrangement would produce an error: <slide><image>..</slide></image>. Knowing that a document is well formed makes it possible to process it. A well-formed document may not be valid however. To determine that, you need a validating parser and a DTD.
    According to the above definition the XML document I have violates the constraints and not well formed. But you can argue that the XML document I got is not an XML document but it is just some document :) Then anyway, I am not sure about all this terminology...
    The technique you suggested seems reasonable but as far as I know the SAX parser stops parsing when a fatal error is encountered. So I don't know how I will trap/ignore the error and continue...
    As for the JTidy suggestion:
    I have tried using HttpUnit which uses JTidy and couldn't get it right. I think when a DOM is created using JTidy the document must also be well formed (XHTML or whatever)...Am I wrong here?
    Thanks a lot...

  • XML-error: Not well-formed (invalid token)

    Hello,
    I want a new XML structure in the Script from my InDesign CS6 (MAC 10.7.4) document. Here ist my little testscript:
         var doc = app.documents.item(0);
         var allStories = doc.stories;
        newXML = new XML('<root></root>');
        for(var i = 0; i < allStories.length; i++) {
            var curStory = allStories[i];
             for(var j = 0; j < curStory.textStyleRanges.length; j++) {
                var textStyleRange = curStory.textStyleRanges[j];
                alert(textStyleRange.contents);
                t = new XML('<content>' +textStyleRange.contents + '</content>');
                newXML.appendChild(t);
        alert(newXML);
    The document has a text frame with the text, such as "C & A". When the script starts, it shows me the error message "XML-error: Not well-formed (invalid token)" on.
    The problem with the "&" is. Probably also other Characters.
    I think InDesign can automatically convert this into "&amp;" or other entities, but how?

    I solved the Problem.
    The line with
    t = new XML('<content>' +textStyleRange.contents + '</content>');
    is the Problem. textStyleRange.contents is not converted. The right way is here for the line:
    t = new XML('<content></content>');
    t.appendChild(textStyleRange.contents);

  • Not well-formed error while implementin ajax in firefox---can anyone help

    hi techies,
    I'm trying to implement ajax in firefox and i'm getting not well-formed error in error console
    heres part of code
    var xmlHttp;
    function create(){
    if(window.ActiveXObject){
    xmlHttp=window.ActiveXObject("Microsoft.XMLHTTP");
    else if(window.XMLHttpRequest){
    xmlHttp=window.XMLHttpRequest();
    else{
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    function getEmployeeDetails(){
    frm = document.forms[0];
    empid = frm.elements["empid"].value;
    url="empdetails.jsp?empid=" + empid;
    xmlHttp.open("GET" ,url, true);
    xmlHttp.onreadystatechange=doUpdate;
    xmlHttp.send(null);
    function doUpdate(){
    if(xmlHttp.readyState==4 && xmlHttp.status == 200){
    var root = xmlHttp.responseXML.documentElement;
    ----so on
    jsp Page is
    <%@ page import="java.sql.*" contentType="text/xml" %>
    <%
    String empid=request.getParameter("empid");
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:vmouli","hr","hr");
    Statement st=con.createStatement();
    ResultSet rs=st.executeQuery("select first_name,salary from employees where employee_id=" + empid);
    if(rs.next()){
    out.println("<employee><name>");out.println(rs.getString(1));
    out.println("</name><salary>");out.println(rs.getString(2));
    out.println("</salary></employee>");
    else{
    out.println("<error>Employee ID not found</error>");
    rs.close();
    st.close();
    con.close();
    %>
    Firefox error console is saying not well-formed and is pointing to starting of my jsp page
    can anyone help plzzz

    mouli007 wrote:
    Thanx for that Cotton
    My XML document is wellformed no doubt about thatNo doubt about that?!?
    I would say there is a great deal of doubt about that, especially since the subject of this thread, which you stated was the error message from FireFox is that the document is not well formed at all. I have some more wild guesses about what you've screwed up. Would you like to hear them? My best guess at this point would be that you are outputting some whitespace at the start of the output.
    Anyway, this seems pretty pointless. Your code is crap. And I really don't see the point in telling us you have an error, posting code, then having several people identify several major problems in your code and then for you tell us that your code is perfect. Your code is not perfect. It's terrible. Fix it. You've been given several ideas in this and your cross-post as to how to fix it.

  • Not well-formed error in firefox in implementing ajax--pls help

    hi techies,
    I'm trying to implement ajax in firefox and i'm getting not well-formed error in error console
    heres part of code
    var xmlHttp;
    function create(){
    if(window.ActiveXObject){
    xmlHttp=window.ActiveXObject("Microsoft.XMLHTTP");
    else if(window.XMLHttpRequest){
    xmlHttp=window.XMLHttpRequest();
    else{
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    function getEmployeeDetails(){
    frm = document.forms[0];
    empid = frm.elements["empid"].value;
    url="empdetails.jsp?empid=" + empid;
    xmlHttp.open("GET" ,url, true);
    xmlHttp.onreadystatechange=doUpdate;
    xmlHttp.send(null);
    function doUpdate(){
    if(xmlHttp.readyState==4 && xmlHttp.status == 200){
    var root = xmlHttp.responseXML.documentElement;
    ----so on
    jsp Page is
    <%@ page import="java.sql.*" contentType="text/xml" %>
    <%
    String empid=request.getParameter("empid");
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:vmouli","hr","hr");
    Statement st=con.createStatement();
    ResultSet rs=st.executeQuery("select first_name,salary from employees where employee_id=" + empid);
    if(rs.next()){
    out.println("<employee><name>");out.println(rs.getString(1));
    out.println("</name><salary>");out.println(rs.getString(2));
    out.println("</salary></employee>");
    else{
    out.println("<error>Employee ID not found</error>");
    rs.close();
    st.close();
    con.close();
    %>
    Firefox error console is saying not well-formed and is pointing to starting of my jsp page
    can anyone help plzzz

    As BalusC said - run the JSP producing the xml.
    Save that xml to a file - INCLUDING any white space - because thats what you actually get.
    Open that xml file in your browser - it should tell you at that point if your xml is well formed.
    AS BalusC said this is better done in a servlet - especially since you're just doing out.println.
    JSPs add extra whitespace and carriage returns. While that won't necessarily break XML, it can cause problems with the first few characters.

  • XML Parsing Error: not well-formed (C# Visual Studio 2013)

    I am working on a project in visual studio that imports a csv, and exports an xml file. I'd like to be able to get the code to work as xml and html, and view it in a browser. I am getting this error when I load the xml file into a browser:
    Firefox
    XML Parsing Error: not well-formed Location: file:///C:/Users/fenwky/XmlDoc.xml Line Number 2, Column 6:?> -----^
    Chrome
    This page contains the following errors: error on line 2 at column 16: colon are forbidden from PI names 'xsl:transform'
    This is what my c# code looks like in visual studio 2013:
    // Create a procesing instruction.
    XmlProcessingInstruction newPI;
    // Stylesheet
    String PItext = "<abc:stylesheet xmlns:abc=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">";
    newPI = doc.CreateProcessingInstruction("abc:stylesheet", PItext);
    doc.InsertAfter(newPI, doc.FirstChild);
    // Save document
    doc.Save(xmlfilename);

    Hi
    Kylee Fenwick,
    Could you show us your CSV file? And the code how do you imports a csv and exports an xml file?
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.
    Hi Kristen,
    Thank you in advance for your healp. Here is my CSV file:
    Item Code;Item Description;Current Count;On Order
    A0001;"Wheels, Horse on";5;No
    A0002;"Wheels, Elephant on";2;No
    A0003;"Wheels, Dog on";0;Yes
    A0004;"Wheels, Seal on";3;No
    A0005;"Wheels, Bear on";7;No
    A0006;"Bear, Teddy";2;Yes
    A0007;"Clown,";5;No
    A0008;"Puppy(crouch),";3;No
    A0009;"Puppy(stand),";2;No
    A0010;"Puppy(jump),";2;Yes
    A0011;"Pupp(lying),";1;Yes
    A0012;"(50), Cart with Blocks";0;Yes
    A0013;"(100), Cart with Blocks";5;No
    A0014;"(200), Cart with Blocks";4;No
    A0015;"Carriage, Train with 0";12;No
    A0016;"Carriage, Train with 1";10;No
    A0017;"Carriage, Train with 2";5;Yes
    A0018;"Carriage, Train with 3";4;Yes
    A0019;"Carriage, Train with 4";5;No
    A0020;"Carriage, Train with 5";2;No
    A0021;"(20), Building Blocks";15;No
    A0022;"(30), Building Blocks";13;No
    A0023;"(40), Building Blocks";16;No
    A0024;"(50), Building Blocks";5;Yes
    A0025;"(100), Building Blocks";2;Yes
    A0026;"(200), Building Blocks";8;No
    A0027;"Windmill,";5;No
    A0028;"Farmhouse,";6;Yes
    A0029;"Fencing,";22;Yes
    A0030;"Barn,";12;Yes
    A0031;"Tractor,";6;Yes
    A0032;"Animals,";3;Yes
    A0033;"House,";9;No
    A0034;"Car,";12;No
    A0035;"(small), Building";4;No
    A0036;"(medium), Building";3;No
    A0037;"(tall), Building";4;No
    A0038;"Shop,";7;No
    A0039;"Lights, Traffic";5;Yes
    A0040;"Station, Petrol";4;Yes
    And here is my code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    using System.Data.OleDb;
    using System.Xml;
    using System.Xml.Xsl;
    using System.Xml.XPath;
    namespace CSVImporter
    public partial class CSVImporter : Form
    //const string xmlfilename = @"C:\Users\fenwky\XmlDoc.xml"; - file name and location of xml file
    const string xmlfilename = @"C:\Users\fenwky\XmlDoc.xml";
    // New code
    //const string xmlfilename = @"C:\Users\fenwky\XmlDoc.xml"; - file name and location of xsl file
    const string stylesheetsimple = @"C:\Users\fenwky\style1.xsl";
    //const string xmlfilecomplex = @"C:\Users\fenwky\XmlDoc2.xml";
    const string xmlfilecomplex = @"C:\Users\fenwky\XmlDoc2.xml";
    DataSet ds = null;
    public CSVImporter()
    InitializeComponent();
    // Create a Open File Dialog Object.
    openFileDialog1.Filter = "csv files (*.csv)|*.csv|All files (*.*)|*.*";
    openFileDialog1.ShowDialog();
    string fileName = openFileDialog1.FileName;
    //doc.InsertBefore(xDeclare, root);
    // Create a CSV Reader object.
    CSVReader reader = new CSVReader();
    ds = reader.ReadCSVFile(fileName, true);
    dataGridView1.DataSource = ds.Tables["Table1"];
    private void WXML_Click(object sender, EventArgs e)
    WriteXML();
    public void WriteXML()
    StringWriter stringWriter = new StringWriter();
    ds.WriteXml(new XmlTextWriter(stringWriter), XmlWriteMode.WriteSchema);
    string xmlStr = stringWriter.ToString();
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(xmlStr);
    XmlDeclaration xDeclare = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
    XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
    doc.InsertBefore(xDeclare, doc.FirstChild);
    // Test code //
    // Load the style sheet.
    XslCompiledTransform xslt = new XslCompiledTransform();
    xslt.Load("style1.xsl");
    // Test code //
    // Transform the file and output an HTML string.
    string HTMLoutput;
    StringWriter writer = new StringWriter();
    xslt.Transform("XmlDoc.xml", null, writer);
    HTMLoutput = writer.ToString();
    writer.Close();
    // Create a procesing instruction.
    XmlProcessingInstruction newPI;
    // Stylesheet
    // String PItext = "<abc:stylesheet xmlns:abc=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">";
    String PItext = "<xsl:stylesheet xmlns:xls=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">";
    // newPI = doc.CreateProcessingInstruction("abc:stylesheet", PItext);
    newPI = doc.CreateProcessingInstruction("xls:stylesheet", PItext);
    doc.InsertAfter(newPI, doc.FirstChild);
    // Save document
    doc.Save(xmlfilename);
    private void btExportComplexXML_Click(object sender, EventArgs e)
    WriteXMLComplex();
    public void WriteXMLComplex()
    // Creates stringwriter
    StringWriter stringWriter = new StringWriter();
    ds.WriteXml(new XmlTextWriter(stringWriter), XmlWriteMode.WriteSchema);
    string xmlStr = stringWriter.ToString();
    XmlDocument doc = new XmlDocument();
    doc.LoadXml(xmlStr);
    XmlDeclaration xDeclare = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
    XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
    doc.InsertBefore(xDeclare, doc.FirstChild);
    // Create a procesing instruction.
    XmlProcessingInstruction newPI;
    // Uses XML transformation.
    String PItext = "<abc:stylesheet xmlns:abc=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">";
    newPI = doc.CreateProcessingInstruction("xsl:stylesheet", PItext);
    doc.InsertAfter(newPI, doc.FirstChild);
    // Saves document.
    doc.Save(xmlfilecomplex);
    //Creates a CSVReader Class
    public class CSVReader
    public DataSet ReadCSVFile(string fullPath, bool headerRow)
    string path = fullPath.Substring(0, fullPath.LastIndexOf("\\") + 1);
    string filename = fullPath.Substring(fullPath.LastIndexOf("\\") + 1);
    DataSet ds = new DataSet();
    try
    if (File.Exists(fullPath))
    string ConStr = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}" + ";Extended Properties=\"Text;HDR={1};FMT=Delimited\\\"", path, headerRow ? "Yes" : "No");
    string SQL = string.Format("SELECT * FROM {0}", filename);
    OleDbDataAdapter adapter = new OleDbDataAdapter(SQL, ConStr);
    adapter.Fill(ds, "TextFile");
    ds.Tables[0].TableName = "Table1";
    foreach (DataColumn col in ds.Tables["Table1"].Columns)
    col.ColumnName = col.ColumnName.Replace(" ", "_");
    catch (Exception ex)
    MessageBox.Show(ex.Message);
    return ds;

  • Error using XML Loader: XML not well-formed

    Hi all,
    I am facing a problem using the XML loader in xMII 12.0 when trying to load the following XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <Users>
      <User>
        <UserID>IMXOO</UserID>
        <CWID>IMXOO</CWID>
        <Prename>Michael</Prename>
        <Surname>Otto</Surname>
        <CreatedOn>2001-12-31T12:00:00</CreatedOn>
        <CreatedBy>IMXOO</CreatedBy>
      </User>
    </Users>
    I also tried a most basic XML file which shows the same error:
    <?xml version="1.0"?>
    <ausgabe>
      <anzeige>Testausgabe</ausgabe>
    </ausgabe>
    To my understanding both files are well-formed, however xMII shows the error:
    "The markup in the document following the root element must be well-formed."
    Do I break any rules concerning the markup? IE loads the files without showing any errors.
    Best Regards
    Michael

    Jeremy,
    again you gave the key to the solution. When the error occured, I have set up the following path within the xMII workbench:
    "Catalog-Tab"
    <server>
      > Sandbox
            > XML
                myFile.xml
    When I tried to load the mxFile.xml with the XML Loader, I got the error described above (XML not well-formed). I also cannot drag the file into a transaction in the workbench. I have manually configured the XML Loader with "http://<server:port>/XMII/CM/Sandbox/XML/mxFile".
    Now using your hint I have changed to the "Web-Tab":
    "Web-Tab"
    <server>
        > Sandbox
            > WEB
                > XML
                    myFile.xml
    Then all works fine, when I now drag the file into the transaction. As you described, an XML Loader action is created with configuration "db://Sandbox/WEB/XML/myFile.xml" and the XML is loaded correctly.
    Thanks for your help!
    Best regards
    Michael

Maybe you are looking for